code: public static <K,V> Map<?, ?> collectEntries(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure<?> transform) {
          return collectEntries(self, createSimilarMap(self), transform);
      }
docs: Iterates through this Map transforming each entry using the <code>transform</code> closure
  and returning a map of the transformed entries.
  <pre class="groovyTestCase">
  assert [a:1, b:2].collectEntries { key, value {@code ->} [value, key] } == [1:'a', 2:'b']
  assert [a:1, b:2].collectEntries { key, value {@code ->}
  [(value*10): key.toUpperCase()] } == [10:'A', 20:'B']
  </pre>
  Note: When using the list-style of result, the behavior is '<code>def (key, value) = listResultFromClosure</code>'.
  While we strongly discourage using a list of size other than 2, Groovy's normal semantics apply in this case;
  throwing away elements after the second one and using null for the key or value for the case of a shortened list.
  If your Map doesn't support null keys or values, you might get a runtime error, e.g. NullPointerException or IllegalArgumentException.
  
  @param self      a Map
  @param transform the closure used for transforming, which can take one (Map.Entry) or two (key, value) parameters and
  should return a Map.Entry, a Map or a two-element list containing the resulting key and value
  @return a Map of the transformed entries
  @see #collect(Map, Collection, Closure)
  @since 1.7.9