MvcGraph { public void inject(final Object target) { if (uiThreadRunner.isOnUiThread()) { try { graph.inject(target, Inject.class); } catch (PokeException e) { throw new MvcGraphException(e.getMessage(), e); } } else { uiThreadRunner.post(new Runnable() { @Override public void run() { try { graph.inject(target, Inject.class); } catch (PokeException e) { throw new MvcGraphException(e.getMessage(), e); } } }); } }  void registerMonitor(final Graph.Monitor monitor); void unregisterMonitor(final Graph.Monitor monitor); void clearMonitors(); T reference(Class<T> type, Annotation qualifier); void dereference(T instance, Class<T> type, Annotation qualifier); void use(final Class<T> type, final Consumer<T> consumer); void use(final Class<T> type, final Annotation qualifier, final Consumer<T> consumer); void inject(final Object target); void release(final Object target); void setRootComponent(final MvcComponent component); MvcComponent getRootComponent(); void registerDereferencedListener(
            final Provider.DereferenceListener onProviderFreedListener); void unregisterDereferencedListener(
            final Provider.DereferenceListener onProviderFreedListener); void clearDereferencedListeners();  }
@Test(expected = MvcGraphException.class) public void should_raise_mvc_graph_exception_when_inject_on_poke_exception() { class View { @Inject UnimplementedInterface unimplementedInterface; } graph.inject(new View()); }
@Test public void should_throw_exception_when_mvc_graph_inject_on_non_main_thread() { when(graph.uiThreadRunner.isOnUiThread()).thenReturn(false); graph.inject(this); when(graph.uiThreadRunner.isOnUiThread()).thenReturn(true); graph.inject(this); }