@Test public void testEquals() { Model mo = new DefaultModel(); Set<VM> x = new HashSet<>(Arrays.asList(mo.newVM(), mo.newVM())); Spread s = new Spread(x); Assert.assertTrue(s.equals(s)); Assert.assertTrue(new Spread(x).equals(s)); Assert.assertEquals(s.hashCode(), new Spread(x).hashCode()); Assert.assertNotEquals(s.hashCode(), new Spread(new HashSet<>()).hashCode()); x = new HashSet<>(Collections.singletonList(mo.newVM())); Assert.assertFalse(new Spread(x).equals(s)); Assert.assertFalse(new Spread(x, false).equals(new Spread(x, true))); Assert.assertNotSame(new Spread(x, false).hashCode(), new Spread(x, true).hashCode()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Spread spread = (Spread) o; return isContinuous() == spread.isContinuous() && Objects.equals(vms, spread.vms); }
Spread extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Spread spread = (Spread) o; return isContinuous() == spread.isContinuous() && Objects.equals(vms, spread.vms); } }
Spread extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Spread spread = (Spread) o; return isContinuous() == spread.isContinuous() && Objects.equals(vms, spread.vms); } Spread(Set<VM> vms);  Spread(Set<VM> vms, boolean continuous); }
Spread extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Spread spread = (Spread) o; return isContinuous() == spread.isContinuous() && Objects.equals(vms, spread.vms); } Spread(Set<VM> vms);  Spread(Set<VM> vms, boolean continuous); @Override String toString(); @Override SpreadChecker getChecker(); @Override Set<VM> getInvolvedVMs(); @Override boolean equals(Object o); @Override int hashCode(); }
Spread extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Spread spread = (Spread) o; return isContinuous() == spread.isContinuous() && Objects.equals(vms, spread.vms); } Spread(Set<VM> vms);  Spread(Set<VM> vms, boolean continuous); @Override String toString(); @Override SpreadChecker getChecker(); @Override Set<VM> getInvolvedVMs(); @Override boolean equals(Object o); @Override int hashCode();  }