RxJavaPlugins { public RxJavaObservableExecutionHook getObservableExecutionHook() { if (observableExecutionHook.get() == null) { Object impl = getPluginImplementationViaProperty(RxJavaObservableExecutionHook.class); if (impl == null) { observableExecutionHook.compareAndSet(null, RxJavaObservableExecutionHookDefault.getInstance()); } else { observableExecutionHook.compareAndSet(null, (RxJavaObservableExecutionHook) impl); } } return observableExecutionHook.get(); } RxJavaPlugins(); static RxJavaPlugins getInstance(); RxJavaErrorHandler getErrorHandler(); void registerErrorHandler(RxJavaErrorHandler impl); RxJavaObservableExecutionHook getObservableExecutionHook(); void registerObservableExecutionHook(RxJavaObservableExecutionHook impl); RxJavaSchedulersHook getSchedulersHook(); void registerSchedulersHook(RxJavaSchedulersHook impl);  }
@Test public void testObservableExecutionHookDefaultImpl() { RxJavaPlugins p = new RxJavaPlugins(); RxJavaObservableExecutionHook impl = p.getObservableExecutionHook(); assertTrue(impl instanceof RxJavaObservableExecutionHookDefault); }
@Test public void testObservableExecutionHookViaProperty() { try { RxJavaPlugins p = new RxJavaPlugins(); String fullClass = getFullClassNameForTestClass(RxJavaObservableExecutionHookTestImpl.class); System.setProperty("rxjava.plugin.RxJavaObservableExecutionHook.implementation", fullClass); RxJavaObservableExecutionHook impl = p.getObservableExecutionHook(); assertTrue(impl instanceof RxJavaObservableExecutionHookTestImpl); } finally { System.clearProperty("rxjava.plugin.RxJavaObservableExecutionHook.implementation"); } }