code: public static <K, V> Set<Map.Entry<K, V>> entries(Map<K, V> m) {
          if (m == null) {
              return emptySet();
          }
          return m.entrySet();
      }
docs: Returns a {@link Set} view of the entries contained in this map.
  <p>
  This method should <strong>always</strong> be preferred instead of
  iterating a maps keys and invoking {@link Map#get(Object) get()} on each
  iteration. The following code should never be used:
  
  <pre>
  <code>
  Map<String, String> map = [...]
  for (final String key : map.keySet()) {
  String value = map.get(key);
  // do something with key/value
  }
  </code>
  </pre>
  
  Instead, write:
  
  <pre>
  <code>
  Map<String, String> map = [...]
  for (final Entry<String, String> e : entries(map)) {
  // do something with e.getKey/e.getValue
  }
  </code>
  </pre>
  
  </p>
  
  @param m {@link Map}; may be null
  @return {@link Set} of {@link java.util.Map.Entry map entries}