@Test public void testEquals() { Assert.assertFalse(createGoldSample() == createGoldSample()); Assert.assertTrue(createGoldSample().equals(createGoldSample())); Assert.assertFalse(createPredSample().equals(createGoldSample())); Assert.assertFalse(createPredSample().equals(new Object())); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof SentenceSample) { SentenceSample a = (SentenceSample) obj; return getDocument().equals(a.getDocument()) && Arrays.equals(getSentences(), a.getSentences()); } return false; }
SentenceSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof SentenceSample) { SentenceSample a = (SentenceSample) obj; return getDocument().equals(a.getDocument()) && Arrays.equals(getSentences(), a.getSentences()); } return false; } }
SentenceSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof SentenceSample) { SentenceSample a = (SentenceSample) obj; return getDocument().equals(a.getDocument()) && Arrays.equals(getSentences(), a.getSentences()); } return false; } SentenceSample(CharSequence document, Span... sentences);  SentenceSample(Detokenizer detokenizer, String[][] sentences); }
SentenceSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof SentenceSample) { SentenceSample a = (SentenceSample) obj; return getDocument().equals(a.getDocument()) && Arrays.equals(getSentences(), a.getSentences()); } return false; } SentenceSample(CharSequence document, Span... sentences);  SentenceSample(Detokenizer detokenizer, String[][] sentences); String getDocument(); Span[] getSentences(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
SentenceSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof SentenceSample) { SentenceSample a = (SentenceSample) obj; return getDocument().equals(a.getDocument()) && Arrays.equals(getSentences(), a.getSentences()); } return false; } SentenceSample(CharSequence document, Span... sentences);  SentenceSample(Detokenizer detokenizer, String[][] sentences); String getDocument(); Span[] getSentences(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }