public static NetInterface newNetInterface(String name, String... blocks) { int i; NetInterface iface = new NetInterface(); Cidr cidr; iface.setName(name); for (i = 0; i < blocks.length; i++) { cidr = new Cidr(); cidr.setBlock(blocks[i]); iface.getCidrs().add(cidr); } return iface; }