code: public static <K1, V1, K2, V2> MutableMap<K2, V2> collectIf(
              Map<K1, V1> map,
              final Function2<? super K1, ? super V1, Pair<K2, V2>> function,
              final Predicate2<? super K1, ? super V1> predicate,
              Map<K2, V2> target)
      {
          final MutableMap<K2, V2> result = MapAdapter.adapt(target);
  
          MapIterate.forEachKeyValue(map, new Procedure2<K1, V1>()
          {
              public void value(K1 key, V1 value)
              {
                  if (predicate.accept(key, value))
                  {
                      Pair<K2, V2> pair = function.value(key, value);
                      result.put(pair.getOne(), pair.getTwo());
                  }
              }
          });
  
          return result;
      }
docs: For each value of the map, the Predicate2 is evaluated with the key and value as the parameter,
  and if true, then {@code function} is applied.
  The results of these evaluations are collected into the target map.