### Question:
SwitchManager implements AutoCloseable { public synchronized Collection<NodeConnectorId> getTunnelPorts(NodeId nodeId) { Collection<NodeConnectorId> ncIds = new HashSet<>(); SwitchState state = switches.get(nodeId); if (state == null ) { return Collections.emptySet(); } ncIds = Collections2.transform(state.tunnelBuilderByType.values(),new Function<TunnelBuilder, NodeConnectorId>() { @Override public NodeConnectorId apply(TunnelBuilder input) { return input.getNodeConnectorId(); } }); return ncIds; } 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 getTunnelPortsTest1arg() { NodeId nodeId = mock(NodeId.class); Assert.assertTrue(switchManager.getTunnelPorts(nodeId).isEmpty()); SwitchManager.switches.put(nodeId, switchState); Assert.assertFalse(switchManager.getTunnelPorts(nodeId).isEmpty()); }