code: public static <T> Map<String, T> transform(Map<String, T> in, Map<String, String> mapper) {
      Map<String, T> out = new LinkedHashMap<>(in.size());
      for (Map.Entry<String, T> entry : in.entrySet()) {
        String key = entry.getKey();
        if (!mapper.containsKey(key)) {
          out.put(key, entry.getValue()); // keep the original key.
          continue;
        }
        String mappedKey = mapper.get(key);
        if (!isNullOrEmpty(mappedKey)) {
          out.put(mappedKey, entry.getValue());
        }
      }
      return out;
    }
docs: Transforms the given map by replacing the keys mapped by {@code mapper}. Any keys not in the
  mapper preserve their original keys. If a key in the mapper maps to null or a blank string,
  that value is dropped.
  
  <p>e.g. transform({a: 1, b: 2, c: 3}, {a: a, c: ""}) -> {$a: 1, b: 2} - transforms a to $a -
  keeps b - removes c