### Question:
ColorSelector extends AbstractSelector<Creature> { @Override public boolean test(Creature t) { return t.getColor().equals(color); } ColorSelector(Color c); @Override boolean test(Creature t);  }### Answer:
@Test public void testColor() { final var greenCreature = mock(Creature.class); when(greenCreature.getColor()).thenReturn(Color.GREEN); final var redCreature = mock(Creature.class); when(redCreature.getColor()).thenReturn(Color.RED); final var greenSelector = new ColorSelector(Color.GREEN); assertTrue(greenSelector.test(greenCreature)); assertFalse(greenSelector.test(redCreature)); }