void 'Fmap'() {
49 | given: 'a function (a->b) using functional interface coertion'
50 | Function<String,Integer> fn =
51 | { String word -> return word.length() } as Function<String,Integer>
52 | when: 'applying fmap::(a->b) -> fa -> fb'
53 | Maybe.Just<Integer> result = fmap(Just("hi"), fn)
54 | then: 'result should be the expected'
55 | result instanceof Maybe.Just
56 | result.isPresent()
57 | val(result) == 2
58 | }
59 |