@Test
public void testListenerSuccess() throws Exception {

    @SuppressWarnings("unchecked")
    Promise<Void> p1 = mock(Promise.class);
    @SuppressWarnings("unchecked")
    Promise<Void> p2 = mock(Promise.class);
    @SuppressWarnings("unchecked")
    PromiseNotifier<Void, Future<Void>> notifier =
            new PromiseNotifier<Void, Future<Void>>(p1, p2);
    @SuppressWarnings("unchecked")
    Future<Void> future = mock(Future.class);
    when(future.isSuccess()).thenReturn(true);
    when(future.get()).thenReturn(null);
    when(p1.trySuccess(null)).thenReturn(true);
    when(p2.trySuccess(null)).thenReturn(true);
    notifier.operationComplete(future);
    verify(p1).trySuccess(null);
    verify(p2).trySuccess(null);
}