@Test public void testEquals() { Model m = new DefaultModel(); VM v = m.newVM(); List<Node> ns = Util.newNodes(m, 10); Set<Node> nodes = new HashSet<>(Arrays.asList(ns.get(0), ns.get(1))); Ban b = new Ban(v, nodes); Assert.assertTrue(b.equals(b)); Assert.assertTrue(new Ban(v, nodes).equals(b)); Assert.assertEquals(new Ban(v, nodes).hashCode(), b.hashCode()); Assert.assertNotEquals(new Ban(m.newVM(), nodes), b); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Ban ban = (Ban) o; return isContinuous() == ban.isContinuous() && Objects.equals(vm, ban.vm) && nodes.size() == ban.nodes.size() && nodes.containsAll(ban.nodes) && ban.nodes.containsAll(nodes); }
Ban extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Ban ban = (Ban) o; return isContinuous() == ban.isContinuous() && Objects.equals(vm, ban.vm) && nodes.size() == ban.nodes.size() && nodes.containsAll(ban.nodes) && ban.nodes.containsAll(nodes); } }
Ban extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Ban ban = (Ban) o; return isContinuous() == ban.isContinuous() && Objects.equals(vm, ban.vm) && nodes.size() == ban.nodes.size() && nodes.containsAll(ban.nodes) && ban.nodes.containsAll(nodes); } Ban(VM vm, Collection<Node> nodes);  Ban(VM vm, Collection<Node> nodes, boolean continuous);  Ban(VM vm, final Node node); }
Ban extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Ban ban = (Ban) o; return isContinuous() == ban.isContinuous() && Objects.equals(vm, ban.vm) && nodes.size() == ban.nodes.size() && nodes.containsAll(ban.nodes) && ban.nodes.containsAll(nodes); } Ban(VM vm, Collection<Node> nodes);  Ban(VM vm, Collection<Node> nodes, boolean continuous);  Ban(VM vm, final Node node); @Override Collection<Node> getInvolvedNodes(); @Override Collection<VM> getInvolvedVMs(); @Override String toString(); @Override BanChecker getChecker(); static List<Ban> newBan(Collection<VM> vms, Collection<Node> nodes); @Override boolean equals(Object o); @Override int hashCode(); }
Ban extends SimpleConstraint { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Ban ban = (Ban) o; return isContinuous() == ban.isContinuous() && Objects.equals(vm, ban.vm) && nodes.size() == ban.nodes.size() && nodes.containsAll(ban.nodes) && ban.nodes.containsAll(nodes); } Ban(VM vm, Collection<Node> nodes);  Ban(VM vm, Collection<Node> nodes, boolean continuous);  Ban(VM vm, final Node node); @Override Collection<Node> getInvolvedNodes(); @Override Collection<VM> getInvolvedVMs(); @Override String toString(); @Override BanChecker getChecker(); static List<Ban> newBan(Collection<VM> vms, Collection<Node> nodes); @Override boolean equals(Object o); @Override int hashCode();  }