@Test
public void testOptFunc() {

    final Map<String, Integer> nums = new HashMap<>();
    final Function<String, Integer> before = nums::get;
    nums.put("one", 1);
    nums.put("three", 3);
    final Function<String, Optional<Integer>> composed = Util.optFunc(before);
    assertTrue("value for one is present", composed.apply("one").isPresent());
    assertFalse("value for two is empty", composed.apply("two").isPresent());
}