@Override public boolean equals(Object obj) { boolean result; if (obj == this) { result = true; } else if (obj instanceof StringListWrapper) { StringListWrapper other = (StringListWrapper) obj; if (isCaseSensitive) { result = this.stringList.equals(other.getStringList()); } else { result = this.stringList.compareToIgnoreCase(other.getStringList()); } } else { result = false; } return result; }
/** * Tests {@link StringList#compareToIgnoreCase(StringList)}. */ @Test public void testCompareToIgnoreCase() { Assert.assertTrue(new StringList("a", "b").compareToIgnoreCase( new StringList("A", "B"))); }
@Override public boolean equals(Object obj) { boolean result; if (obj == this) { result = true; } else if (obj instanceof StringListWrapper) { StringListWrapper other = (StringListWrapper) obj; if (isCaseSensitive) { result = this.stringList.equals(other.getStringList()); } else { result = this.stringList.compareToIgnoreCase(other.getStringList()); } } else { result = false; } return result; }
@Override public boolean equals(Object obj) { boolean result; if (obj == this) { result = true; } else if (obj instanceof StringListWrapper) { StringListWrapper other = (StringListWrapper) obj; if (isCaseSensitive) { result = this.stringList.equals(other.getStringList()); } else { result = this.stringList.compareToIgnoreCase(other.getStringList()); } } else { result = false; } return result; }