@Test public void testAppliesToCharacterCharacter() { final Character caster = mock(Character.class); final UserCharacter deadUserTarget = mock(UserCharacter.class); when(deadUserTarget.isDead()).thenReturn(Boolean.TRUE); final UserCharacter aliveUserTarget = mock(UserCharacter.class); final NPCCharacter target = mock(NPCCharacter.class); assertFalse(invisibilityEffect.appliesTo(caster, target)); assertFalse(invisibilityEffect.appliesTo(caster, deadUserTarget)); assertTrue(invisibilityEffect.appliesTo(caster, aliveUserTarget)); }
@Override public boolean appliesTo(Character caster, Character target) { if (!(target instanceof UserCharacter) || target.isDead()) { return false; } return true; }
InvisibilityEffect implements Effect { @Override public boolean appliesTo(Character caster, Character target) { if (!(target instanceof UserCharacter) || target.isDead()) { return false; } return true; } }
InvisibilityEffect implements Effect { @Override public boolean appliesTo(Character caster, Character target) { if (!(target instanceof UserCharacter) || target.isDead()) { return false; } return true; }  }
InvisibilityEffect implements Effect { @Override public boolean appliesTo(Character caster, Character target) { if (!(target instanceof UserCharacter) || target.isDead()) { return false; } return true; }  @Override void apply(Character caster, Character target); @Override boolean appliesTo(Character caster, Character target); @Override boolean appliesTo(Character caster, WorldObject worldobject); @Override void apply(Character caster, WorldObject target); }
InvisibilityEffect implements Effect { @Override public boolean appliesTo(Character caster, Character target) { if (!(target instanceof UserCharacter) || target.isDead()) { return false; } return true; }  @Override void apply(Character caster, Character target); @Override boolean appliesTo(Character caster, Character target); @Override boolean appliesTo(Character caster, WorldObject worldobject); @Override void apply(Character caster, WorldObject target);  }