### Question:
SwitchManager implements AutoCloseable { @Override public void close() throws Exception { nodeListener.close(); ofOverlayNodeListener.close(); nodeConnectorListener.close(); } 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 constructorTest() throws Exception { Field fNodeListener = SwitchManager.class.getDeclaredField("nodeListener"); Field fOfOverlayNodeListener = SwitchManager.class.getDeclaredField("ofOverlayNodeListener"); Field fNodeConnectorListener = SwitchManager.class.getDeclaredField("nodeConnectorListener"); fNodeListener.setAccessible(true); fOfOverlayNodeListener.setAccessible(true); fNodeConnectorListener.setAccessible(true); Assert.assertNotNull(fNodeListener.get(switchManager)); Assert.assertNotNull(fOfOverlayNodeListener.get(switchManager)); Assert.assertNotNull(fNodeConnectorListener.get(switchManager)); switchManager.close(); switchManager = new SwitchManager(null); Assert.assertNull(fNodeListener.get(switchManager)); Assert.assertNull(fOfOverlayNodeListener.get(switchManager)); Assert.assertNull(fNodeConnectorListener.get(switchManager)); }