@Test
public void distanceShouldBeGreaterThanTen() {

  // given
  Beacon beacon = Mockito.mock(Beacon.class);
  // when
  when(beacon.getDistance()).then(new Answer<Double>() {
    @Override
    public Double answer(InvocationOnMock invocationOnMock) throws Throwable {
      return 15d;
    }
  });
  Function<Beacon, Boolean> filter = Filter.distanceIsGreaterThan(10);
  Boolean call = apply(filter, beacon);
  // then
  assertThat(call).isTrue();
}