@Test
public void testCompose() {

    final Map<String, Integer> nums = new HashMap<>();
    final Function<String, Integer> before = nums::get;
    nums.put("two", 2);
    nums.put("three", 3);
    final Function<Integer, Long> after = value -> (long) (value * value);
    final Function<String, Long> composed = Util.compose(before, after);
    assertEquals("value for two is a squared long 4",
            4L, composed.apply("two").longValue());
    assertEquals("value for three is a squared long 9",
            9L, composed.apply("three").longValue());
}