public boolean hasCapacity(Node host, NodeResources requestedCapacity) {
        return availableCapacityOf(host).satisfies(requestedCapacity);
    }
@Test
    public void verifyCapacityFromAddresses() {
        Node nodeA = Node.reserve(List.of("::2"), "nodeA", "host1", resources0, NodeType.tenant).build();
        Node nodeB = Node.reserve(List.of("::3"), "nodeB", "host1", resources0, NodeType.tenant).build();
        Node nodeC = Node.reserve(List.of("::4"), "nodeC", "host1", resources0, NodeType.tenant).build();

        // host1 is a host with resources = 7-100-120-5 (7 vcpus, 100G memory, 120G disk, and 5Gbps),
        // while nodeA-C have resources = resources0 = 1-30-20-1.5

        Node host1 = setupHostWithAdditionalHostnames("host1", "nodeA");
        // Allocating nodeA should be OK
        assertTrue(hasCapacity(resources0, host1));
        // then, the second node lacks hostname address
        assertFalse(hasCapacity(resources0, host1, nodeA));

        host1 = setupHostWithAdditionalHostnames("host1", "nodeA", "nodeB");
        // Allocating nodeA and nodeB should be OK
        assertTrue(hasCapacity(resources0, host1));
        assertTrue(hasCapacity(resources0, host1, nodeA));
        // but the third node lacks hostname address
        assertFalse(hasCapacity(resources0, host1, nodeA, nodeB));

        host1 = setupHostWithAdditionalHostnames("host1", "nodeA", "nodeB", "nodeC");
        // Allocating nodeA, nodeB, and nodeC should be OK
        assertTrue(hasCapacity(resources0, host1));
        assertTrue(hasCapacity(resources0, host1, nodeA));
        assertTrue(hasCapacity(resources0, host1, nodeA, nodeB));
        // but the fourth node lacks hostname address
        assertFalse(hasCapacity(resources0, host1, nodeA, nodeB, nodeC));

        host1 = setupHostWithAdditionalHostnames("host1", "nodeA", "nodeB", "nodeC", "nodeD");
        // Allocating nodeA, nodeB, and nodeC should be OK
        assertTrue(hasCapacity(resources0, host1));
        assertTrue(hasCapacity(resources0, host1, nodeA));
        assertTrue(hasCapacity(resources0, host1, nodeA, nodeB));
        // but the fourth lacks memory (host has 100G, while 4x30G = 120G
        assertFalse(hasCapacity(resources0, host1, nodeA, nodeB, nodeC));
    }