@Test
public void checkDoubleResourceMaybeObserver() {

    MaybeObserver<Integer> consumer = new ResourceMaybeObserver<Integer>() {
        @Override
        public void onSuccess(Integer t) {
        }
        @Override
        public void onError(Throwable t) {
        }
        @Override
        public void onComplete() {
        }
    };
    Disposable sub1 = Disposables.empty();
    consumer.onSubscribe(sub1);
    assertFalse(sub1.isDisposed());
    Disposable sub2 = Disposables.empty();
    consumer.onSubscribe(sub2);
    assertFalse(sub1.isDisposed());
    assertTrue(sub2.isDisposed());
    TestHelper.assertError(errors, 0, ProtocolViolationException.class);
    assertEquals(EndConsumerHelper.composeMessage(consumer.getClass().getName()), errors.get(0).getMessage());
    assertEquals(errors.toString(), 1, errors.size());
}