### Question:
SCMNodeStorageStatMap implements SCMNodeStorageStatMXBean { public void insertNewDatanode(UUID datanodeID, Set<StorageLocationReport> report) throws SCMException { Preconditions.checkNotNull(report); Preconditions.checkState(report.size() != 0); Preconditions.checkNotNull(datanodeID); synchronized (scmNodeStorageReportMap) { if (isKnownDatanode(datanodeID)) { throw new SCMException("Node already exists in the map", DUPLICATE_DATANODE); } scmNodeStorageReportMap.putIfAbsent(datanodeID, report); } } SCMNodeStorageStatMap(OzoneConfiguration conf); boolean isKnownDatanode(UUID datanodeID); List<UUID> getDatanodeList(
      UtilizationThreshold threshold); void insertNewDatanode(UUID datanodeID,
      Set<StorageLocationReport> report); void updateDatanodeMap(UUID datanodeID,
      Set<StorageLocationReport> report); StorageReportResult processNodeReport(UUID datanodeID,
      StorageContainerDatanodeProtocolProtos.NodeReportProto nodeReport); @Override long getCapacity(UUID dnId); @Override long getRemainingSpace(UUID dnId); @Override long getUsedSpace(UUID dnId); @Override long getTotalCapacity(); @Override long getTotalSpaceUsed(); @Override long getTotalFreeSpace(); void removeDatanode(UUID datanodeID); @Override Set<StorageLocationReport> getStorageVolumes(UUID datanodeID); double getScmUsedratio(long scmUsed, long capacity);  }### Answer:
@Test public void testInsertNewDatanode() throws SCMException { SCMNodeStorageStatMap map = new SCMNodeStorageStatMap(conf); UUID knownNode = getFirstKey(); Set<StorageLocationReport> report = testData.get(knownNode); map.insertNewDatanode(knownNode, report); Assert.assertEquals(map.getStorageVolumes(knownNode), testData.get(knownNode)); thrown.expect(SCMException.class); thrown.expectMessage("already exists"); map.insertNewDatanode(knownNode, report); }