title: How to write test case for below java code
body: <pre><code>public class CollectionUtils {
      public static &lt;K, V&gt; Map&lt;K, V&gt; createMap(Iterable&lt;V&gt; values, Function&lt;V, K&gt; keyFunction, boolean skipNullKeys) {
          Map&lt;K, V&gt; map = new HashMap&lt;&gt;();
          for (V value : values) {
              K key = keyFunction.apply(value);
              if (key != null || !skipNullKeys) {
                  map.put(key, value);
              }
          }
          return map;
      }
  </code></pre>