@Test public void overrideInitMainSchedulerThrowsWhenSchedulerCallableReturnsNull() { Callable<Scheduler> nullResultCallable = new Callable<Scheduler>() { @Override public Scheduler call() throws Exception { return null; } }; try { RxSwtPlugins.initMainThreadScheduler(nullResultCallable); fail(); } catch (NullPointerException e) { assertEquals("Scheduler Callable returned null", e.getMessage()); } }
public static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler) { if (scheduler == null) { throw new NullPointerException("scheduler == null"); } Function<Callable<Scheduler>, Scheduler> f = onInitMainThreadHandler; if (f == null) { return callRequireNonNull(scheduler); } return applyRequireNonNull(f, scheduler); }
RxSwtPlugins { public static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler) { if (scheduler == null) { throw new NullPointerException("scheduler == null"); } Function<Callable<Scheduler>, Scheduler> f = onInitMainThreadHandler; if (f == null) { return callRequireNonNull(scheduler); } return applyRequireNonNull(f, scheduler); } }
RxSwtPlugins { public static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler) { if (scheduler == null) { throw new NullPointerException("scheduler == null"); } Function<Callable<Scheduler>, Scheduler> f = onInitMainThreadHandler; if (f == null) { return callRequireNonNull(scheduler); } return applyRequireNonNull(f, scheduler); } private  RxSwtPlugins(); }
RxSwtPlugins { public static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler) { if (scheduler == null) { throw new NullPointerException("scheduler == null"); } Function<Callable<Scheduler>, Scheduler> f = onInitMainThreadHandler; if (f == null) { return callRequireNonNull(scheduler); } return applyRequireNonNull(f, scheduler); } private  RxSwtPlugins(); static void setInitMainThreadSchedulerHandler(Function<Callable<Scheduler>, Scheduler> handler); static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler); static void setMainThreadSchedulerHandler(Function<Scheduler, Scheduler> handler); static Scheduler onMainThreadScheduler(Scheduler scheduler); static Function<Callable<Scheduler>, Scheduler> getInitMainThreadSchedulerHandler(); static Function<Scheduler, Scheduler> getOnMainThreadSchedulerHandler(); static void reset(); }
RxSwtPlugins { public static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler) { if (scheduler == null) { throw new NullPointerException("scheduler == null"); } Function<Callable<Scheduler>, Scheduler> f = onInitMainThreadHandler; if (f == null) { return callRequireNonNull(scheduler); } return applyRequireNonNull(f, scheduler); } private  RxSwtPlugins(); static void setInitMainThreadSchedulerHandler(Function<Callable<Scheduler>, Scheduler> handler); static Scheduler initMainThreadScheduler(Callable<Scheduler> scheduler); static void setMainThreadSchedulerHandler(Function<Scheduler, Scheduler> handler); static Scheduler onMainThreadScheduler(Scheduler scheduler); static Function<Callable<Scheduler>, Scheduler> getInitMainThreadSchedulerHandler(); static Function<Scheduler, Scheduler> getOnMainThreadSchedulerHandler(); static void reset();  }