### Question:
NewNodeCatchUpTaskGroup { public boolean add(NewNodeCatchUpTask task) { return taskMap.putIfAbsent(task.getNodeId(), task) == null; }  boolean add(NewNodeCatchUpTask task); boolean onReceiveAppendEntriesResult(AppendEntriesResultMessage resultMessage, int nextLogIndex); boolean onReceiveInstallSnapshotResult(InstallSnapshotResultMessage resultMessage, int nextLogIndex); boolean remove(NewNodeCatchUpTask task);  }### Answer:
@Test public void testAdd() { NewNodeCatchUpTaskGroup group = new NewNodeCatchUpTaskGroup(); NewNodeCatchUpTask task = new NewNodeCatchUpTask( new WaitableNewNodeCatchUpTaskContext(), new NodeEndpoint("D", "localhost", 2336), new NodeConfig() ); Assert.assertTrue(group.add(task)); }
@Test public void testAdd2() { NewNodeCatchUpTaskGroup group = new NewNodeCatchUpTaskGroup(); NewNodeCatchUpTask task = new NewNodeCatchUpTask( new WaitableNewNodeCatchUpTaskContext(), new NodeEndpoint("D", "localhost", 2336), new NodeConfig() ); Assert.assertTrue(group.add(task)); Assert.assertFalse(group.add(task)); }