@CheckReturnValue
  public static Disposable loadDictionaryInBackground(@NonNull Dictionary dictionary) {
    return loadDictionaryInBackground(NO_OP_LISTENER, dictionary);
  }
@Test
  public void testFailedToLoad() {
    Dictionary dictionary = Mockito.mock(Dictionary.class);
    final RuntimeException runtimeException = new RuntimeException();
    Mockito.doThrow(runtimeException).when(dictionary).loadDictionary();
    DictionaryBackgroundLoader.Listener listener =
        Mockito.mock(DictionaryBackgroundLoader.Listener.class);

    final Disposable disposable =
        DictionaryBackgroundLoader.loadDictionaryInBackground(listener, dictionary);

    TestRxSchedulers.drainAllTasks();

    final InOrder inOrder = Mockito.inOrder(listener, dictionary);
    inOrder.verify(dictionary).loadDictionary();
    inOrder.verify(dictionary).close();
    inOrder.verify(listener).onDictionaryLoadingFailed(same(dictionary), same(runtimeException));
    inOrder.verifyNoMoreInteractions();

    disposable.dispose();
    TestRxSchedulers.drainAllTasks();
    Mockito.verify(dictionary).close();
  }