TokenSample { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj instanceof TokenSample) { TokenSample a = (TokenSample) obj; return getText().equals(a.getText()) && Arrays.equals(getTokenSpans(), a.getTokenSpans()); } else { return false; } } TokenSample(String text, Span tokenSpans[]);  TokenSample(Detokenizer detokenizer, String tokens[]); String getText(); Span[] getTokenSpans(); @Override String toString(); static TokenSample parse(String sampleString, String separatorChars); @Override boolean equals(Object obj); static final String DEFAULT_SEPARATOR_CHARS; }
@Test public void testEquals() { assertFalse(createGoldSample() == createGoldSample()); assertTrue(createGoldSample().equals(createGoldSample())); assertFalse(createPredSample().equals(createGoldSample())); assertFalse(createPredSample().equals(new Object())); }