@Test
public void testMapKey() {

    final Map<String, Integer> refMap = new LinkedHashMap<>();
    refMap.put("one", 1);
    refMap.put("two", 2);
    refMap.put("three", 3);
    Set<String> collected = refMap.entrySet().stream()
            .map(mapKey(string -> string + "_" + string)).collect(entriesToMap()).keySet();
    assertEquals("mapKey should result in same list",
            new LinkedHashSet<>(Arrays.asList("one_one", "two_two", "three_three")), collected);
}