### Question:
DoubleName { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final DoubleName that = (DoubleName) o; return Objects.equals(this.nameWithAliases, that.nameWithAliases); } DoubleName(String name, Collection<String> aliases); String getName(); Collection<String> getAliases(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); boolean hasName(String beanName);  }### Answer:
@Test public void names_with_different_names_nas_aliases_should_not_be_equal() { final DoubleName aName = new DoubleName("a", asList("b", "c")); final DoubleName otherName = new DoubleName("1", asList("2", "3")); assertFalse(aName.equals(otherName)); }
@Test public void names_with_the_same_name_and_different_aliases_should_not_be_equal() { final DoubleName name = new DoubleName("a", asList("b", "c")); final DoubleName otherName = new DoubleName("a", asList("2", "3")); assertFalse(name.equals(otherName)); }