@Test
public void testRemovedSwitch() {

    LinkDiscoveryManager topology = getTopology();
    Link lt = new Link(1L, 2, 2L, 1);
    NodePortTuple srcNpt = new NodePortTuple(1L, 2);
    NodePortTuple dstNpt = new NodePortTuple(2L, 1);
    LinkInfo info = new LinkInfo(System.currentTimeMillis(),
                                 System.currentTimeMillis(), null,
                                 0, 0);
    topology.addOrUpdateLink(lt, info);
    IOFSwitch sw1 = getMockFloodlightProvider().getSwitches().get(1L);
    IOFSwitch sw2 = getMockFloodlightProvider().getSwitches().get(2L);
    // Mock up our expected behavior
    topology.removedSwitch(sw1);
    verify(sw1, sw2);
    // check invariants hold
    assertNull(topology.switchLinks.get(lt.getSrc()));
    assertNull(topology.switchLinks.get(lt.getDst()));
    assertNull(topology.portLinks.get(srcNpt));
    assertNull(topology.portLinks.get(dstNpt));
    assertTrue(topology.links.isEmpty());
}