### Question:
NodeReportHandler implements EventHandler<NodeReportFromDatanode> { @Override public void onMessage(NodeReportFromDatanode nodeReportFromDatanode, EventPublisher publisher) { Preconditions.checkNotNull(nodeReportFromDatanode); DatanodeDetails dn = nodeReportFromDatanode.getDatanodeDetails(); Preconditions.checkNotNull(dn, "NodeReport is " + "missing DatanodeDetails."); nodeManager .processNodeReport(dn, nodeReportFromDatanode.getReport()); } NodeReportHandler(NodeManager nodeManager); @Override void onMessage(NodeReportFromDatanode nodeReportFromDatanode,
      EventPublisher publisher);  }### Answer:
@Test public void testNodeReport() throws IOException { DatanodeDetails dn = MockDatanodeDetails.randomDatanodeDetails(); StorageReportProto storageOne = TestUtils .createStorageReport(dn.getUuid(), storagePath, 100, 10, 90, null); SCMNodeMetric nodeMetric = nodeManager.getNodeStat(dn); Assert.assertNull(nodeMetric); nodeManager.register(dn, getNodeReport(dn, storageOne).getReport(), null); nodeMetric = nodeManager.getNodeStat(dn); Assert.assertTrue(nodeMetric.get().getCapacity().get() == 100); Assert.assertTrue(nodeMetric.get().getRemaining().get() == 90); Assert.assertTrue(nodeMetric.get().getScmUsed().get() == 10); StorageReportProto storageTwo = TestUtils .createStorageReport(dn.getUuid(), storagePath, 100, 10, 90, null); nodeReportHandler.onMessage( getNodeReport(dn, storageOne, storageTwo), this); nodeMetric = nodeManager.getNodeStat(dn); Assert.assertTrue(nodeMetric.get().getCapacity().get() == 200); Assert.assertTrue(nodeMetric.get().getRemaining().get() == 180); Assert.assertTrue(nodeMetric.get().getScmUsed().get() == 20); }