@Test public void testEquals() throws InvalidFormatException { 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 (obj == this) { return true; } if (obj instanceof POSSample) { POSSample a = (POSSample) obj; return Arrays.equals(getSentence(), a.getSentence()) && Arrays.equals(getTags(), a.getTags()); } return this == obj; }
POSSample implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof POSSample) { POSSample a = (POSSample) obj; return Arrays.equals(getSentence(), a.getSentence()) && Arrays.equals(getTags(), a.getTags()); } return this == obj; } }
POSSample implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof POSSample) { POSSample a = (POSSample) obj; return Arrays.equals(getSentence(), a.getSentence()) && Arrays.equals(getTags(), a.getTags()); } return this == obj; } POSSample(String[] sentence, String[] tags);  POSSample(List<String> sentence, List<String> tags);  POSSample(List<String> sentence, List<String> tags,
      String[][] additionalContext);  POSSample(String[] sentence, String[] tags,
      String[][] additionalContext); }
POSSample implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof POSSample) { POSSample a = (POSSample) obj; return Arrays.equals(getSentence(), a.getSentence()) && Arrays.equals(getTags(), a.getTags()); } return this == obj; } POSSample(String[] sentence, String[] tags);  POSSample(List<String> sentence, List<String> tags);  POSSample(List<String> sentence, List<String> tags,
      String[][] additionalContext);  POSSample(String[] sentence, String[] tags,
      String[][] additionalContext); String[] getSentence(); String[] getTags(); String[][] getAddictionalContext(); @Override String toString(); static POSSample parse(String sentenceString); @Override int hashCode(); @Override boolean equals(Object obj); }
POSSample implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof POSSample) { POSSample a = (POSSample) obj; return Arrays.equals(getSentence(), a.getSentence()) && Arrays.equals(getTags(), a.getTags()); } return this == obj; } POSSample(String[] sentence, String[] tags);  POSSample(List<String> sentence, List<String> tags);  POSSample(List<String> sentence, List<String> tags,
      String[][] additionalContext);  POSSample(String[] sentence, String[] tags,
      String[][] additionalContext); String[] getSentence(); String[] getTags(); String[][] getAddictionalContext(); @Override String toString(); static POSSample parse(String sentenceString); @Override int hashCode(); @Override boolean equals(Object obj);  }