@Test public void testHasCharacter() { assertTrue(account.hasCharacter(TEST_CHARACTER_NAME)); assertFalse(account.hasCharacter(NON_EXISTING_CHARACTER_NAME)); }
@Override public boolean hasCharacter(String name) { String nameLower = name.toLowerCase(); for (String character : characters) { if (nameLower.equals(character.toLowerCase())) { return true; } } return false; }
AccountImpl implements Account { @Override public boolean hasCharacter(String name) { String nameLower = name.toLowerCase(); for (String character : characters) { if (nameLower.equals(character.toLowerCase())) { return true; } } return false; } }
AccountImpl implements Account { @Override public boolean hasCharacter(String name) { String nameLower = name.toLowerCase(); for (String character : characters) { if (nameLower.equals(character.toLowerCase())) { return true; } } return false; } AccountImpl(String name, String password, String mail, Set<String> characters, boolean banned); }
AccountImpl implements Account { @Override public boolean hasCharacter(String name) { String nameLower = name.toLowerCase(); for (String character : characters) { if (nameLower.equals(character.toLowerCase())) { return true; } } return false; } AccountImpl(String name, String password, String mail, Set<String> characters, boolean banned); @Override String getName(); @Override String getMail(); @Override Set<String> getCharacters(); @Override boolean hasCharacter(String name); @Override boolean isBanned(); @Override boolean authenticate(String password); @Override void addCharacter(String name); @Override void setBanned(boolean banned); @Override int hashCode(); @Override boolean equals(final Object obj); }
AccountImpl implements Account { @Override public boolean hasCharacter(String name) { String nameLower = name.toLowerCase(); for (String character : characters) { if (nameLower.equals(character.toLowerCase())) { return true; } } return false; } AccountImpl(String name, String password, String mail, Set<String> characters, boolean banned); @Override String getName(); @Override String getMail(); @Override Set<String> getCharacters(); @Override boolean hasCharacter(String name); @Override boolean isBanned(); @Override boolean authenticate(String password); @Override void addCharacter(String name); @Override void setBanned(boolean banned); @Override int hashCode(); @Override boolean equals(final Object obj);  }