@Test public void fromAction() { class AtomicAction extends AtomicBoolean implements Action { private static final long serialVersionUID = -1517510584253657229L; @Override public void run() throws Exception { set(true); } } AtomicAction aa = new AtomicAction(); Disposables.fromAction(aa).dispose(); assertTrue(aa.get()); }
@NonNull public static Disposable fromAction(@NonNull Action run) { ObjectHelper.requireNonNull(run, "run is null"); return new ActionDisposable(run); }
Disposables { @NonNull public static Disposable fromAction(@NonNull Action run) { ObjectHelper.requireNonNull(run, "run is null"); return new ActionDisposable(run); } }
Disposables { @NonNull public static Disposable fromAction(@NonNull Action run) { ObjectHelper.requireNonNull(run, "run is null"); return new ActionDisposable(run); } private  Disposables(); }
Disposables { @NonNull public static Disposable fromAction(@NonNull Action run) { ObjectHelper.requireNonNull(run, "run is null"); return new ActionDisposable(run); } 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 fromAction(@NonNull Action run) { ObjectHelper.requireNonNull(run, "run is null"); return new ActionDisposable(run); } 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();  }