@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 LemmaSample) { LemmaSample a = (LemmaSample) obj; return Arrays.equals(getTokens(), a.getTokens()) && Arrays.equals(getTags(), a.getTags()) && Arrays.equals(getLemmas(), a.getLemmas()); } return false; }
LemmaSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LemmaSample) { LemmaSample a = (LemmaSample) obj; return Arrays.equals(getTokens(), a.getTokens()) && Arrays.equals(getTags(), a.getTags()) && Arrays.equals(getLemmas(), a.getLemmas()); } return false; } }
LemmaSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LemmaSample) { LemmaSample a = (LemmaSample) obj; return Arrays.equals(getTokens(), a.getTokens()) && Arrays.equals(getTags(), a.getTags()) && Arrays.equals(getLemmas(), a.getLemmas()); } return false; } LemmaSample(String[] tokens, String[] tags, String[] lemmas);  LemmaSample(List<String> tokens, List<String> tags, List<String> lemmas); }
LemmaSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LemmaSample) { LemmaSample a = (LemmaSample) obj; return Arrays.equals(getTokens(), a.getTokens()) && Arrays.equals(getTags(), a.getTags()) && Arrays.equals(getLemmas(), a.getLemmas()); } return false; } LemmaSample(String[] tokens, String[] tags, String[] lemmas);  LemmaSample(List<String> tokens, List<String> tags, List<String> lemmas); String[] getTokens(); String[] getTags(); String[] getLemmas(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
LemmaSample implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LemmaSample) { LemmaSample a = (LemmaSample) obj; return Arrays.equals(getTokens(), a.getTokens()) && Arrays.equals(getTags(), a.getTags()) && Arrays.equals(getLemmas(), a.getLemmas()); } return false; } LemmaSample(String[] tokens, String[] tags, String[] lemmas);  LemmaSample(List<String> tokens, List<String> tags, List<String> lemmas); String[] getTokens(); String[] getTags(); String[] getLemmas(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }