@Test public void testEquals() { List<FieldRow> groups = Collections.singletonList(FieldRow.create("f1", 42)); GroupCount g = GroupCount.create(groups, 10); assertTrue(g.equals(g)); assertFalse(g.equals(new Integer(10))); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof GroupCount)) { return false; } GroupCount rhs = (GroupCount) obj; return new EqualsBuilder() .append(this.groups, rhs.groups) .append(this.count, rhs.count) .isEquals(); }
GroupCount { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof GroupCount)) { return false; } GroupCount rhs = (GroupCount) obj; return new EqualsBuilder() .append(this.groups, rhs.groups) .append(this.count, rhs.count) .isEquals(); } }
GroupCount { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof GroupCount)) { return false; } GroupCount rhs = (GroupCount) obj; return new EqualsBuilder() .append(this.groups, rhs.groups) .append(this.count, rhs.count) .isEquals(); } private  GroupCount(List<FieldRow> groups, long count); }
GroupCount { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof GroupCount)) { return false; } GroupCount rhs = (GroupCount) obj; return new EqualsBuilder() .append(this.groups, rhs.groups) .append(this.count, rhs.count) .isEquals(); } private  GroupCount(List<FieldRow> groups, long count); static GroupCount create(List<FieldRow> groups, long count); final List<FieldRow> getGroups(); long getCount(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
GroupCount { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof GroupCount)) { return false; } GroupCount rhs = (GroupCount) obj; return new EqualsBuilder() .append(this.groups, rhs.groups) .append(this.count, rhs.count) .isEquals(); } private  GroupCount(List<FieldRow> groups, long count); static GroupCount create(List<FieldRow> groups, long count); final List<FieldRow> getGroups(); long getCount(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }