FullHalfPair implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } FullHalfPair that = (FullHalfPair) o; if (!fullwidth.equals(that.fullwidth)) { return false; } return halfwidth.equals(that.halfwidth); } FullHalfPair(String fullwidth, String halfwidth); String fullwidth(); String halfwidth(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testFullHalfPairEquals() { FullHalfPair FullHalfPair1 = new FullHalfPair("ａ", "a"); FullHalfPair FullHalfPair2 = new FullHalfPair("ａ", "a"); FullHalfPair FullHalfPair3 = FullHalfPair1; assertThat(FullHalfPair1.equals(FullHalfPair2), is(true)); assertThat(FullHalfPair1.equals(FullHalfPair3), is(true)); }
@Test @SuppressWarnings("unlikely-arg-type") public void testFullHalfPairEqualsNull() { FullHalfPair FullHalfPair = new FullHalfPair("ａ", "a"); String str = null; assertThat(FullHalfPair.equals(str), is(false)); }
@Test @SuppressWarnings("unlikely-arg-type") public void testFullHalfPairEqualsDifferentClass() { FullHalfPair FullHalfPair = new FullHalfPair("ａ", "a"); String str = "a"; assertThat(FullHalfPair.equals(str), is(false)); }
@Test public void testFullWidthNotEquals() { FullHalfPair FullHalfPair1 = new FullHalfPair("ａ", "a"); FullHalfPair FullHalfPair2 = new FullHalfPair("b", "b"); assertThat(FullHalfPair1.equals(FullHalfPair2), is(false)); }
@Test public void testHalfWidthNotEquals() { FullHalfPair FullHalfPair1 = new FullHalfPair("ａ", "a"); FullHalfPair FullHalfPair2 = new FullHalfPair("ａ", "b"); assertThat(FullHalfPair1.equals(FullHalfPair2), is(false)); }