@Test public void testEquals() { Assert.assertFalse(CIS1.equals(STRING1)); Assert.assertTrue(CIS1.equals(new CaseInsensitiveString(STRING2))); }
@Override public boolean equals(final Object obj) { if (obj instanceof CaseInsensitiveString) { final CaseInsensitiveString other = (CaseInsensitiveString) obj; return name.equals(other.name); } return false; }
CaseInsensitiveString implements Comparable<CaseInsensitiveString> { @Override public boolean equals(final Object obj) { if (obj instanceof CaseInsensitiveString) { final CaseInsensitiveString other = (CaseInsensitiveString) obj; return name.equals(other.name); } return false; } }
CaseInsensitiveString implements Comparable<CaseInsensitiveString> { @Override public boolean equals(final Object obj) { if (obj instanceof CaseInsensitiveString) { final CaseInsensitiveString other = (CaseInsensitiveString) obj; return name.equals(other.name); } return false; } CaseInsensitiveString(final String name); }
CaseInsensitiveString implements Comparable<CaseInsensitiveString> { @Override public boolean equals(final Object obj) { if (obj instanceof CaseInsensitiveString) { final CaseInsensitiveString other = (CaseInsensitiveString) obj; return name.equals(other.name); } return false; } CaseInsensitiveString(final String name); @Override int compareTo(final CaseInsensitiveString other); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString(); }
CaseInsensitiveString implements Comparable<CaseInsensitiveString> { @Override public boolean equals(final Object obj) { if (obj instanceof CaseInsensitiveString) { final CaseInsensitiveString other = (CaseInsensitiveString) obj; return name.equals(other.name); } return false; } CaseInsensitiveString(final String name); @Override int compareTo(final CaseInsensitiveString other); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }