code: public static <K, V> Map<K, V> findAll(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class)  Closure closure) {
          Map<K, V> answer = createSimilarMap(self);
          BooleanClosureWrapper bcw = new BooleanClosureWrapper(closure);
          for (Map.Entry<K, V> entry : self.entrySet()) {
              if (bcw.callForMap(entry)) {
                  answer.put(entry.getKey(), entry.getValue());
              }
          }
          return answer;
      }
docs: Finds all entries matching the closure condition. If the
  closure takes one parameter then it will be passed the Map.Entry.
  Otherwise if the closure should take two parameters, which will be
  the key and the value.
  <p>
  If the <code>self</code> map is one of TreeMap, LinkedHashMap, Hashtable
  or Properties, the returned Map will preserve that type, otherwise a HashMap will
  be returned.
  <p>
  Example usage:
  <pre class="groovyTestCase">
  def result = [a:1, b:2, c:4, d:5].findAll { it.value % 2 == 0 }
  assert result.every { it instanceof Map.Entry }
  assert result*.key == ["b", "c"]
  assert result*.value == [2, 4]
  </pre>
  
  @param self    a Map
  @param closure a 1 or 2 arg Closure condition applying on the entries
  @return a new subMap
  @since 1.0