@Test public void validateSubscription() { BooleanSubscription d1 = new BooleanSubscription(); assertFalse(EndConsumerHelper.validate(SubscriptionHelper.CANCELLED, d1, getClass())); assertTrue(d1.isCancelled()); assertTrue(errors.toString(), errors.isEmpty()); }
public static boolean validate(Disposable upstream, Disposable next, Class<?> observer) { ObjectHelper.requireNonNull(next, "next is null"); if (upstream != null) { next.dispose(); if (upstream != DisposableHelper.DISPOSED) { reportDoubleSubscription(observer); } return false; } return true; }
EndConsumerHelper { public static boolean validate(Disposable upstream, Disposable next, Class<?> observer) { ObjectHelper.requireNonNull(next, "next is null"); if (upstream != null) { next.dispose(); if (upstream != DisposableHelper.DISPOSED) { reportDoubleSubscription(observer); } return false; } return true; } }
EndConsumerHelper { public static boolean validate(Disposable upstream, Disposable next, Class<?> observer) { ObjectHelper.requireNonNull(next, "next is null"); if (upstream != null) { next.dispose(); if (upstream != DisposableHelper.DISPOSED) { reportDoubleSubscription(observer); } return false; } return true; } private  EndConsumerHelper(); }
EndConsumerHelper { public static boolean validate(Disposable upstream, Disposable next, Class<?> observer) { ObjectHelper.requireNonNull(next, "next is null"); if (upstream != null) { next.dispose(); if (upstream != DisposableHelper.DISPOSED) { reportDoubleSubscription(observer); } return false; } return true; } private  EndConsumerHelper(); static boolean validate(Disposable upstream, Disposable next, Class<?> observer); static boolean setOnce(AtomicReference<Disposable> upstream, Disposable next, Class<?> observer); static boolean validate(Subscription upstream, Subscription next, Class<?> subscriber); static boolean setOnce(AtomicReference<Subscription> upstream, Subscription next, Class<?> subscriber); static String composeMessage(String consumer); static void reportDoubleSubscription(Class<?> consumer); }
EndConsumerHelper { public static boolean validate(Disposable upstream, Disposable next, Class<?> observer) { ObjectHelper.requireNonNull(next, "next is null"); if (upstream != null) { next.dispose(); if (upstream != DisposableHelper.DISPOSED) { reportDoubleSubscription(observer); } return false; } return true; } private  EndConsumerHelper(); static boolean validate(Disposable upstream, Disposable next, Class<?> observer); static boolean setOnce(AtomicReference<Disposable> upstream, Disposable next, Class<?> observer); static boolean validate(Subscription upstream, Subscription next, Class<?> subscriber); static boolean setOnce(AtomicReference<Subscription> upstream, Subscription next, Class<?> subscriber); static String composeMessage(String consumer); static void reportDoubleSubscription(Class<?> consumer);  }