### Question:
MovementSelector extends AbstractSelector<Creature> { @Override public boolean test(Creature t) { return t.getMovement().equals(movement); } MovementSelector(Movement m); @Override boolean test(Creature t);  }### Answer:
@Test public void testMovement() { final var swimmingCreature = mock(Creature.class); when(swimmingCreature.getMovement()).thenReturn(Movement.SWIMMING); final var flyingCreature = mock(Creature.class); when(flyingCreature.getMovement()).thenReturn(Movement.FLYING); final var swimmingSelector = new MovementSelector(Movement.SWIMMING); assertTrue(swimmingSelector.test(swimmingCreature)); assertFalse(swimmingSelector.test(flyingCreature)); }