HostCapacity { int freeIPs(Node dockerHost) { return dockerHost.ipConfig().pool().findUnused(allNodes).size(); } HostCapacity(NodeList allNodes, HostResourcesCalculator hostResourcesCalculator); NodeList allNodes(); Set<Node> findSpareHosts(List<Node> candidates, int count); NodeResources freeCapacityOf(Node host);  }
@Test public void freeIPs() { assertEquals(2, capacity.freeIPs(host1)); assertEquals(1, capacity.freeIPs(host2)); assertEquals(0, capacity.freeIPs(host3)); }