@Test public void testEquals() { SubRange group1Elem1 = new SubRange(0, 100); SubRange group1Elem2 = new SubRange(0, 100); SubRange group2Elem1 = new SubRange(1, 100); SubRange group3Elem1 = new SubRange(0, 99); new EqualsTester() .addEqualityGroup(group1Elem1, group1Elem2) .addEqualityGroup(group2Elem1) .addEqualityGroup(group3Elem1) .testEquals(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof SubRange)) { return false; } SubRange other = (SubRange) o; return _start == other._start && _end == other._end; }
SubRange implements Serializable, Comparable<SubRange> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof SubRange)) { return false; } SubRange other = (SubRange) o; return _start == other._start && _end == other._end; } }
SubRange implements Serializable, Comparable<SubRange> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof SubRange)) { return false; } SubRange other = (SubRange) o; return _start == other._start && _end == other._end; } SubRange(int start, int end); @JsonCreator  SubRange(@Nullable Object o); }
SubRange implements Serializable, Comparable<SubRange> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof SubRange)) { return false; } SubRange other = (SubRange) o; return _start == other._start && _end == other._end; } SubRange(int start, int end); @JsonCreator  SubRange(@Nullable Object o); static SubRange singleton(int value); IntStream asStream(); @Override int compareTo(@Nonnull SubRange rhs); boolean contains(@Nonnull SubRange other); @Override boolean equals(Object o); int getEnd(); int getStart(); @Override int hashCode(); boolean includes(@Nullable Integer integer); boolean includes(int integer); Optional<SubRange> intersection(SubRange other); boolean isEmpty(); boolean isSingleValue(); @JsonValue String serializedForm(); @Override String toString(); }
SubRange implements Serializable, Comparable<SubRange> { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof SubRange)) { return false; } SubRange other = (SubRange) o; return _start == other._start && _end == other._end; } SubRange(int start, int end); @JsonCreator  SubRange(@Nullable Object o); static SubRange singleton(int value); IntStream asStream(); @Override int compareTo(@Nonnull SubRange rhs); boolean contains(@Nonnull SubRange other); @Override boolean equals(Object o); int getEnd(); int getStart(); @Override int hashCode(); boolean includes(@Nullable Integer integer); boolean includes(int integer); Optional<SubRange> intersection(SubRange other); boolean isEmpty(); boolean isSingleValue(); @JsonValue String serializedForm(); @Override String toString();  }