@Test
public void testVerifyRoleReplyReceived() {

    LinkedList<OFSwitchImpl> switches = new LinkedList<OFSwitchImpl>();
    
    // Add a switch that has received a role reply
    OFSwitchImpl sw1 = EasyMock.createMock(OFSwitchImpl.class);
    expect(sw1.checkFirstPendingRoleRequestCookie(123456))
                    .andReturn(false).once();
    switches.add(sw1);
    
    // Add a switch that has not yet received a role reply
    OFSwitchImpl sw2 = EasyMock.createMock(OFSwitchImpl.class);
    expect(sw2.checkFirstPendingRoleRequestCookie(123456))
                    .andReturn(true).once();
    Channel channel2 = createMock(Channel.class);
    expect(sw2.getChannel()).andReturn(channel2);
    expect(channel2.close()).andReturn(null);
    switches.add(sw2);
    
    
    replay(sw1, sw2);
    roleChanger.verifyRoleReplyReceived(switches, 123456);
    verify(sw1, sw2);
    
    assertEquals(2, switches.size());
}