@Test public void setOnceTwice() { List<Throwable> errors = TestHelper.trackPluginErrors(); try { AtomicReference<Disposable> target = new AtomicReference<Disposable>(); Disposable d = Disposables.empty(); DisposableHelper.setOnce(target, d); Disposable d1 = Disposables.empty(); DisposableHelper.setOnce(target, d1); assertTrue(d1.isDisposed()); TestHelper.assertError(errors, 0, IllegalStateException.class, "Disposable already set!"); } finally { RxJavaPlugins.reset(); } }
@NonNull public static Disposable empty() { return fromRunnable(Functions.EMPTY_RUNNABLE); }
Disposables { @NonNull public static Disposable empty() { return fromRunnable(Functions.EMPTY_RUNNABLE); } }
Disposables { @NonNull public static Disposable empty() { return fromRunnable(Functions.EMPTY_RUNNABLE); } private  Disposables(); }
Disposables { @NonNull public static Disposable empty() { return fromRunnable(Functions.EMPTY_RUNNABLE); } private  Disposables(); @NonNull static Disposable fromRunnable(@NonNull Runnable run); @NonNull static Disposable fromAction(@NonNull Action run); @NonNull static Disposable fromFuture(@NonNull Future<?> future); @NonNull static Disposable fromFuture(@NonNull Future<?> future, boolean allowInterrupt); @NonNull static Disposable fromSubscription(@NonNull Subscription subscription); @NonNull static Disposable empty(); @NonNull static Disposable disposed(); }
Disposables { @NonNull public static Disposable empty() { return fromRunnable(Functions.EMPTY_RUNNABLE); } private  Disposables(); @NonNull static Disposable fromRunnable(@NonNull Runnable run); @NonNull static Disposable fromAction(@NonNull Action run); @NonNull static Disposable fromFuture(@NonNull Future<?> future); @NonNull static Disposable fromFuture(@NonNull Future<?> future, boolean allowInterrupt); @NonNull static Disposable fromSubscription(@NonNull Subscription subscription); @NonNull static Disposable empty(); @NonNull static Disposable disposed();  }