SizeSelector implements Predicate<Creature> { @Override public boolean test(Creature t) { return t.getSize().equals(s); } SizeSelector(Size s); @Override boolean test(Creature t);  }
@Test public void testMovement() { final Creature normalCreature = mock(Creature.class); when(normalCreature.getSize()).thenReturn(Size.NORMAL); final Creature smallCreature = mock(Creature.class); when(smallCreature.getSize()).thenReturn(Size.SMALL); final SizeSelector normalSelector = new SizeSelector(Size.NORMAL); assertTrue(normalSelector.test(normalCreature)); assertFalse(normalSelector.test(smallCreature)); }