@Test
    void testSetNodeStateOutOfRange() throws Exception {
        FleetControllerOptions.Builder options = defaultOptions();
        options.setDistributionConfig(DistributionBuilder.configForFlatCluster(10));
        setUpFleetController(timer, options);
        setUpVdsNodes(timer);
        waitForStableSystem();

        int rpcPort = fleetController().getRpcPort();
        Target connection = supervisor.connect(new Spec("localhost", rpcPort));
        assertTrue(connection.isValid());

        Request req = setNodeState("storage/cluster.mycluster/storage/10", "s:m", connection);
        assertEquals(ErrorCode.METHOD_FAILED, req.errorCode(), req.toString());
        assertEquals("Cannot set wanted state of node storage.10. Index does not correspond to a configured node.", req.errorMessage(), req.toString());

        req = setNodeState("storage/cluster.mycluster/distributor/10", "s:m", connection);
        assertEquals(ErrorCode.METHOD_FAILED, req.errorCode(), req.toString());
        assertEquals("Cannot set wanted state of node distributor.10. Index does not correspond to a configured node.", req.errorMessage(), req.toString());

        req = setNodeState("storage/cluster.mycluster/storage/9", "s:m", connection);
        assertEquals(ErrorCode.NONE, req.errorCode(), req.toString());

        waitForState("version:\\d+ distributor:10 storage:10 .9.s:m");
    }
Note: RpcServer is only used in unit tests

@author humbe
clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/RpcServerTest.java