@Test
public void testBeanConnection() {

    BeanListener mockListener = mock(BeanListener.class);
    bean.connect(mockContext, mockListener);
    testListener.onConnected();
    for (Runnable r : handlerRunnables) {
        r.run();
    }
    verify(mockListener).onConnected();
}