@Test public void testEquals() { Assert.assertEquals(new StringList("a", "b"), new StringList("a", "b")); Assert.assertFalse(new StringList("a", "b").equals( new StringList("A", "B"))); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StringList) { StringList tokenList = (StringList) obj; return Arrays.equals(tokens, tokenList.tokens); } return false; }
StringList implements Iterable<String> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StringList) { StringList tokenList = (StringList) obj; return Arrays.equals(tokens, tokenList.tokens); } return false; } }
StringList implements Iterable<String> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StringList) { StringList tokenList = (StringList) obj; return Arrays.equals(tokens, tokenList.tokens); } return false; } StringList(String singleToken);  StringList(String... tokens); }
StringList implements Iterable<String> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StringList) { StringList tokenList = (StringList) obj; return Arrays.equals(tokens, tokenList.tokens); } return false; } StringList(String singleToken);  StringList(String... tokens); String getToken(int index); int size(); Iterator<String> iterator(); boolean compareToIgnoreCase(StringList tokens); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
StringList implements Iterable<String> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StringList) { StringList tokenList = (StringList) obj; return Arrays.equals(tokens, tokenList.tokens); } return false; } StringList(String singleToken);  StringList(String... tokens); String getToken(int index); int size(); Iterator<String> iterator(); boolean compareToIgnoreCase(StringList tokens); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }