code: protected String getAndRemoveValue(Map<String, String> map, String key) {
  
          String value = map.get(key);
          if (value != null) {
              map.remove(key);
          }
          return value;
      }
docs: Helper method which retrieves a value for a given key from a map and then deletes the entry for the key.<p>
  
  @param map the map from which to retrieve the value
  @param key the key
  
  @return the removed value