@Test public void testEqual() { Property p = new Property("test", ValueType.LONG, Arrays.asList(ValueType.LONG), "test", "", false); List<Object> v1 = Arrays.asList((Object) new Long(1)); List<Object> v2 = Arrays.asList((Object) new Integer(1)); List<Object> v3 = Arrays.asList((Object) new String("1")); List<Object> v4 = Arrays.asList((Object) new Long(100)); List<Object> v5 = Arrays.asList((Object) new Long(1)); PropertyRealParas rp1 = new PropertyRealParas(p, v1); PropertyRealParas rp2 = new PropertyRealParas(p, v2); PropertyRealParas rp3 = new PropertyRealParas(p, v3); PropertyRealParas rp4 = new PropertyRealParas(p, v4); PropertyRealParas rp5 = new PropertyRealParas(p, v5); PropertyRealParas rp6 = new PropertyRealParas(p, null); Assert.assertFalse(rp1.equals(rp2)); Assert.assertFalse(rp1.equals(rp3)); Assert.assertFalse(rp1.equals(rp4)); Assert.assertFalse(!rp1.equals(rp5)); Assert.assertFalse(rp1.equals(rp6)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyRealParas that = (PropertyRealParas) o; return Objects.equals(property, that.property) && Objects.equals(values, that.values); }
PropertyRealParas { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyRealParas that = (PropertyRealParas) o; return Objects.equals(property, that.property) && Objects.equals(values, that.values); } }
PropertyRealParas { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyRealParas that = (PropertyRealParas) o; return Objects.equals(property, that.property) && Objects.equals(values, that.values); } PropertyRealParas(Property p, List<Object> values); }
PropertyRealParas { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyRealParas that = (PropertyRealParas) o; return Objects.equals(property, that.property) && Objects.equals(values, that.values); } PropertyRealParas(Property p, List<Object> values); Property getProperty(); List<Object> getValues(); @Override boolean equals(Object o); @Override int hashCode(); String formatParameters(); String instId(); String instId(int s, int e); }
PropertyRealParas { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PropertyRealParas that = (PropertyRealParas) o; return Objects.equals(property, that.property) && Objects.equals(values, that.values); } PropertyRealParas(Property p, List<Object> values); Property getProperty(); List<Object> getValues(); @Override boolean equals(Object o); @Override int hashCode(); String formatParameters(); String instId(); String instId(int s, int e);  }