### Question:
NodeManagerCollector extends AbstractActivityCollector implements INodeMessageListener { @Handler @Override public void onNodeConnected(NodeConnectMessage message) { ActivityItem item = ActivityItem.create() .setTitle("Node connected.") .setDescription(String.format( "Client connected to the network. Address connected to: %s", message.getNodeAddress())); getActivityLogger().addActivityItem(item); } @Inject protected  NodeManagerCollector(ActivityLogger activityLogger); @Handler @Override void onNodeConnected(NodeConnectMessage message); @Handler @Override void onNodeDisconnected(NodeDisconnectMessage message);  }### Answer:
@Test public void testOnNodeConnected() { NodeConnectMessage msg = new NodeConnectMessage("127.0.0.1"); collector.onNodeConnected(msg); CollectorTestUtils.captureAddActivityItem(ActivityType.INFORMATION, activityLogger); }