@Test public void testDeleteSubNet() throws Exception { Network network = new Network(); network.setNetworkName(NETWORK_NAME); SubNetwork subnet = new SubNetwork(SUBNETWORK_NAME, VDC, REGION); Set<SubNetwork> subNets = new HashSet<SubNetwork>(); subNets.add(subnet); network.setSubNets(subNets); network.deleteSubNet(subnet); assertEquals(network.getSubNets().size(), 0); }
public void deleteSubNet(SubNetwork subNet) { if (subNets.contains(subNet)) { subNets.remove(subNet); } }
Network { public void deleteSubNet(SubNetwork subNet) { if (subNets.contains(subNet)) { subNets.remove(subNet); } } }
Network { public void deleteSubNet(SubNetwork subNet) { if (subNets.contains(subNet)) { subNets.remove(subNet); } } Network();  Network(String name, String vdc, String region); }
Network { public void deleteSubNet(SubNetwork subNet) { if (subNets.contains(subNet)) { subNets.remove(subNet); } } Network();  Network(String name, String vdc, String region); void addSubNet(SubNetwork subNet); Set<SubNetwork> cloneSubNets(); void deleteSubNet(SubNetwork subNet); void updateSubNet(SubNetwork subNet); boolean contains(SubNetwork subNet); String getNetworkName(); String getRegion(); void setNetworkName(String name); String getVdc(); void setVdc(String vdc); void setFederatedNetwork(boolean federatedNetwork); boolean getfederatedNetwork(); void setFederatedRange(String range); String getFederatedRange(); Set<SubNetwork> getSubNets(); void setSubNets(Set<SubNetwork> subNets); NetworkDto toDto(); NetworkInstance toNetworkInstance(); @Override boolean equals(Object obj); @Override int hashCode(); String toString(); }
Network { public void deleteSubNet(SubNetwork subNet) { if (subNets.contains(subNet)) { subNets.remove(subNet); } } Network();  Network(String name, String vdc, String region); void addSubNet(SubNetwork subNet); Set<SubNetwork> cloneSubNets(); void deleteSubNet(SubNetwork subNet); void updateSubNet(SubNetwork subNet); boolean contains(SubNetwork subNet); String getNetworkName(); String getRegion(); void setNetworkName(String name); String getVdc(); void setVdc(String vdc); void setFederatedNetwork(boolean federatedNetwork); boolean getfederatedNetwork(); void setFederatedRange(String range); String getFederatedRange(); Set<SubNetwork> getSubNets(); void setSubNets(Set<SubNetwork> subNets); NetworkDto toDto(); NetworkInstance toNetworkInstance(); @Override boolean equals(Object obj); @Override int hashCode(); String toString();  }