### Question:
SwitchManager implements AutoCloseable { public static void deactivatingSwitch(NodeId nodeId) { SwitchState state = switches.get(nodeId); if (state == null) { LOG.error("No SwitchState for {} in deactivatingSwitch. This should not happen.",nodeId); return; } state.setHasEndpoints(false); state.updateStatus(); } SwitchManager(DataBroker dataProvider); static void activatingSwitch(NodeId nodeId); static void deactivatingSwitch(NodeId nodeId); synchronized InstanceIdentifier<NodeConnector> getNodeConnectorIidForPortName(Name portName); synchronized Collection<NodeId> getReadySwitches(); synchronized Set<NodeConnectorId> getExternalPorts(NodeId nodeId); Set<Long> getExternalPortNumbers(NodeId nodeId); synchronized Collection<NodeConnectorId> getTunnelPorts(NodeId nodeId); synchronized NodeConnectorId getTunnelPort(NodeId nodeId, Class<? extends TunnelTypeBase> tunnelType); synchronized IpAddress getTunnelIP(NodeId nodeId, Class<? extends TunnelTypeBase> tunnelType); void registerListener(SwitchListener listener); void setEncapsulationFormat(EncapsulationFormat format); @Override void close();  }### Answer:
@Test public void deactivatingSwitchTest() { NodeId nodeId = mock(NodeId.class); SwitchManager.switches.put(nodeId, null); SwitchManager.deactivatingSwitch(nodeId); Assert.assertNull(SwitchManager.switches.get(nodeId)); }