### Question:
BaseCliRequestProcessor extends RpcRequestProcessor<T> { protected abstract String getGroupId(T request); BaseCliRequestProcessor(Executor executor, Message defaultResp); @Override Message processRequest(T request, RpcRequestClosure done);  }### Answer:
@Test public void testManyNodes() { Node node1 = Mockito.mock(Node.class); Mockito.when(node1.getGroupId()).thenReturn("test"); Mockito.when(node1.getNodeId()).thenReturn(new NodeId("test", new PeerId("localhost", 8081))); NodeOptions opts = new NodeOptions(); Mockito.when(node1.getOptions()).thenReturn(opts); NodeManager.getInstance().addAddress(new Endpoint("localhost", 8081)); NodeManager.getInstance().add(node1); Node node2 = Mockito.mock(Node.class); Mockito.when(node2.getGroupId()).thenReturn("test"); Mockito.when(node2.getNodeId()).thenReturn(new NodeId("test", new PeerId("localhost", 8082))); Mockito.when(node2.getOptions()).thenReturn(opts); NodeManager.getInstance().addAddress(new Endpoint("localhost", 8082)); NodeManager.getInstance().add(node2); this.processor = new MockCliRequestProcessor(null, "test"); this.processor.handleRequest(asyncContext, TestUtils.createPingRequest()); ErrorResponse resp = (ErrorResponse) asyncContext.getResponseObject(); assertNotNull(resp); assertEquals(RaftError.EINVAL.getNumber(), resp.getErrorCode()); assertEquals("Peer must be specified since there're 2 nodes in group test", resp.getErrorMsg()); }