@Test public void testEquals() { Model mo = new DefaultModel(); Util.newNodes(mo, 3); List<VM> vms = Util.newVMs(mo, 3); Collection<VM> s1 = Collections.singleton(vms.get(0)); Collection<VM> s2 = Collections.singleton(vms.get(1)); List<Collection<VM>> args = Arrays.asList(s1, s2); Split sp = new Split(args); Assert.assertTrue(sp.equals(sp)); Assert.assertTrue(new Split(args).equals(sp)); Assert.assertEquals(new Split(args).hashCode(), sp.hashCode()); List<Collection<VM>> args2 = new ArrayList<>(args); args2.add(Collections.singleton(vms.get(2))); Assert.assertFalse(new Split(args2).equals(sp)); Assert.assertNotEquals(new Split(args, true), new Split(args, false)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Split split = (Split) o; return isContinuous() == split.isContinuous() && Objects.equals(sets, split.sets); }
Split extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Split split = (Split) o; return isContinuous() == split.isContinuous() && Objects.equals(sets, split.sets); } }
Split extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Split split = (Split) o; return isContinuous() == split.isContinuous() && Objects.equals(sets, split.sets); } Split(Collection<Collection<VM>> parts);  Split(Collection<Collection<VM>> parts, boolean continuous); }
Split extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Split split = (Split) o; return isContinuous() == split.isContinuous() && Objects.equals(sets, split.sets); } Split(Collection<Collection<VM>> parts);  Split(Collection<Collection<VM>> parts, boolean continuous); @Override Set<VM> getInvolvedVMs(); Collection<Collection<VM>> getSets(); Collection<VM> getAssociatedVGroup(VM u); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override SplitChecker getChecker(); }
Split extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Split split = (Split) o; return isContinuous() == split.isContinuous() && Objects.equals(sets, split.sets); } Split(Collection<Collection<VM>> parts);  Split(Collection<Collection<VM>> parts, boolean continuous); @Override Set<VM> getInvolvedVMs(); Collection<Collection<VM>> getSets(); Collection<VM> getAssociatedVGroup(VM u); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override SplitChecker getChecker();  }