@Test
    public void add_and_remove() {
        NodeRepositoryTester tester = new NodeRepositoryTester();
        assertEquals(0, tester.nodeRepository().nodes().list().size());

        tester.addHost("id1", "host1", "default", NodeType.host);
        tester.addHost("id2", "host2", "default", NodeType.host);
        tester.addHost("id3", "host3", "default", NodeType.host);
        tester.addHost("id4", "cfghost1", "default", NodeType.confighost);

        assertEquals(4, tester.nodeRepository().nodes().list().size());

        for (var hostname : List.of("host2", "cfghost1")) {
            tester.nodeRepository().nodes().park(hostname, false, Agent.system, "Parking to unit test");
            tester.nodeRepository().nodes().removeRecursively(hostname);
        }

        assertEquals(4, tester.nodeRepository().nodes().list().size());
        assertEquals(2, tester.nodeRepository().nodes().list(Node.State.deprovisioned).size());
    }
tests basic operation of the node repository

@author bratseth
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/NodeRepositoryTest.java