@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 DocumentSample) { DocumentSample a = (DocumentSample) obj; return getCategory().equals(a.getCategory()) && Arrays.equals(getText(), a.getText()); } return false; }
DocumentSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DocumentSample) { DocumentSample a = (DocumentSample) obj; return getCategory().equals(a.getCategory()) && Arrays.equals(getText(), a.getText()); } return false; } }
DocumentSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DocumentSample) { DocumentSample a = (DocumentSample) obj; return getCategory().equals(a.getCategory()) && Arrays.equals(getText(), a.getText()); } return false; } DocumentSample(String category, String[] text);  DocumentSample(String category, String[] text, Map<String, Object> extraInformation); }
DocumentSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DocumentSample) { DocumentSample a = (DocumentSample) obj; return getCategory().equals(a.getCategory()) && Arrays.equals(getText(), a.getText()); } return false; } DocumentSample(String category, String[] text);  DocumentSample(String category, String[] text, Map<String, Object> extraInformation); String getCategory(); String[] getText(); Map<String, Object> getExtraInformation(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
DocumentSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof DocumentSample) { DocumentSample a = (DocumentSample) obj; return getCategory().equals(a.getCategory()) && Arrays.equals(getText(), a.getText()); } return false; } DocumentSample(String category, String[] text);  DocumentSample(String category, String[] text, Map<String, Object> extraInformation); String getCategory(); String[] getText(); Map<String, Object> getExtraInformation(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }