Loader { @MainThread public final void setCallbacks(@Nullable final Callbacks<T> callbacks) { this.callbacks = callbacks; handler.removeMessages(0); if (callbacks != null) { int methods = 0; if (hasResult()) { methods |= CALLBACKS_RESULT; } else if (isRunning()) { methods |= CALLBACKS_START; } if (isCompleted()) { methods |= CALLBACKS_COMPLETE; } dispatchCallbacks(callbacks, methods); } }  @MainThread final void start(); @MainThread final void cancel(); @MainThread final void restart(); @MainThread final void destroy(); final boolean isRunning(); final boolean hasResult(); final boolean isCompleted(); final boolean isAttached(); @MainThread final void setCallbacks(@Nullable final Callbacks<T> callbacks);  }
@Test public void newlyCreatedDoesNotCallCallbacks() { Loader.Callbacks<String> callbacks = mock(Loader.Callbacks.class); loader.setCallbacks(callbacks); verifyZeroInteractions(callbacks); }