### Question:
SCMNodeManager implements NodeManager { @Override public List<SCMCommand> processHeartbeat(DatanodeDetails datanodeDetails) { Preconditions.checkNotNull(datanodeDetails, "Heartbeat is missing " + "DatanodeDetails."); try { nodeStateManager.updateLastHeartbeatTime(datanodeDetails); metrics.incNumHBProcessed(); } catch (NodeNotFoundException e) { metrics.incNumHBProcessingFailed(); LOG.error("SCM trying to process heartbeat from an " + "unregistered node {}. Ignoring the heartbeat.", datanodeDetails); } return commandQueue.getCommand(datanodeDetails.getUuid()); } SCMNodeManager(OzoneConfiguration conf,
      SCMStorageConfig scmStorageConfig, EventPublisher eventPublisher,
      NetworkTopology networkTopology); @Override List<DatanodeDetails> getNodes(NodeState nodestate); @Override List<DatanodeDetails> getAllNodes(); @Override int getNodeCount(NodeState nodestate); @Override NodeState getNodeState(DatanodeDetails datanodeDetails); @Override void close(); @Override VersionResponse getVersion(SCMVersionRequestProto versionRequest); @Override RegisteredCommand register(
      DatanodeDetails datanodeDetails, NodeReportProto nodeReport,
      PipelineReportsProto pipelineReportsProto); @Override List<SCMCommand> processHeartbeat(DatanodeDetails datanodeDetails); @Override Boolean isNodeRegistered(DatanodeDetails datanodeDetails); @Override void processNodeReport(DatanodeDetails datanodeDetails,
      NodeReportProto nodeReport); @Override SCMNodeStat getStats(); @Override Map<DatanodeDetails, SCMNodeStat> getNodeStats(); @Override SCMNodeMetric getNodeStat(DatanodeDetails datanodeDetails); @Override Map<String, Integer> getNodeCount(); @Override Map<String, Long> getNodeInfo(); @Override int minHealthyVolumeNum(List<DatanodeDetails> dnList); @Override int pipelineLimit(DatanodeDetails dn); @Override int minPipelineLimit(List<DatanodeDetails> dnList); @Override Set<PipelineID> getPipelines(DatanodeDetails datanodeDetails); @Override int getPipelinesCount(DatanodeDetails datanodeDetails); @Override void addPipeline(Pipeline pipeline); @Override void removePipeline(Pipeline pipeline); @Override void addContainer(final DatanodeDetails datanodeDetails,
      final ContainerID containerId); @Override void setContainers(DatanodeDetails datanodeDetails,
      Set<ContainerID> containerIds); @Override Set<ContainerID> getContainers(DatanodeDetails datanodeDetails); @Override void addDatanodeCommand(UUID dnId, SCMCommand command); @Override void onMessage(CommandForDatanode commandForDatanode,
      EventPublisher ignored); @Override List<SCMCommand> getCommandQueue(UUID dnID); @Override DatanodeDetails getNodeByUuid(String uuid); @Override List<DatanodeDetails> getNodesByAddress(String address); @Override NetworkTopology getClusterNetworkTopologyMap();  }### Answer:
@Test public void testScmCheckForErrorOnNullDatanodeDetails() throws IOException, AuthenticationException { try (SCMNodeManager nodeManager = createNodeManager(getConf())) { nodeManager.processHeartbeat(null); } catch (NullPointerException npe) { GenericTestUtils.assertExceptionContains("Heartbeat is missing " + "DatanodeDetails.", npe); } }