@Test public void testEquals() { Model mo = new DefaultModel(); VM v = mo.newVM(); Set<Node> nodes = new HashSet<>(Arrays.asList(mo.newNode(), mo.newNode())); Fence f = new Fence(v, nodes); Assert.assertTrue(f.equals(f)); Assert.assertTrue(new Fence(v, nodes).equals(f)); Assert.assertFalse(new Fence(mo.newVM(), nodes).equals(f)); Assert.assertEquals(new Fence(v, nodes).hashCode(), f.hashCode()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Fence fence = (Fence) o; return isContinuous() == fence.isContinuous() && Objects.equals(vm, fence.vm) && nodes.size() == fence.nodes.size() && nodes.containsAll(fence.nodes) && fence.nodes.containsAll(nodes); }
Fence extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Fence fence = (Fence) o; return isContinuous() == fence.isContinuous() && Objects.equals(vm, fence.vm) && nodes.size() == fence.nodes.size() && nodes.containsAll(fence.nodes) && fence.nodes.containsAll(nodes); } }
Fence extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Fence fence = (Fence) o; return isContinuous() == fence.isContinuous() && Objects.equals(vm, fence.vm) && nodes.size() == fence.nodes.size() && nodes.containsAll(fence.nodes) && fence.nodes.containsAll(nodes); } Fence(VM vm, Collection<Node> nodes);  Fence(VM vm, Node... n);  Fence(VM vm, Collection<Node> nodes, boolean continuous); }
Fence extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Fence fence = (Fence) o; return isContinuous() == fence.isContinuous() && Objects.equals(vm, fence.vm) && nodes.size() == fence.nodes.size() && nodes.containsAll(fence.nodes) && fence.nodes.containsAll(nodes); } Fence(VM vm, Collection<Node> nodes);  Fence(VM vm, Node... n);  Fence(VM vm, Collection<Node> nodes, boolean continuous); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); @Override FenceChecker getChecker(); @Override Collection<Node> getInvolvedNodes(); @Override Collection<VM> getInvolvedVMs(); static List<Fence> newFence(Collection<VM> vms, Collection<Node> nodes); }
Fence extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Fence fence = (Fence) o; return isContinuous() == fence.isContinuous() && Objects.equals(vm, fence.vm) && nodes.size() == fence.nodes.size() && nodes.containsAll(fence.nodes) && fence.nodes.containsAll(nodes); } Fence(VM vm, Collection<Node> nodes);  Fence(VM vm, Node... n);  Fence(VM vm, Collection<Node> nodes, boolean continuous); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); @Override FenceChecker getChecker(); @Override Collection<Node> getInvolvedNodes(); @Override Collection<VM> getInvolvedVMs(); static List<Fence> newFence(Collection<VM> vms, Collection<Node> nodes);  }