### Question:
OkDownload { public static OkDownload with() { if (singleton == null) { synchronized (OkDownload.class) { if (singleton == null) { if (OkDownloadProvider.context == null) { throw new IllegalStateException("context == null"); } singleton = new Builder(OkDownloadProvider.context).build(); } } } return singleton; } OkDownload(Context context, DownloadDispatcher downloadDispatcher,
               CallbackDispatcher callbackDispatcher, DownloadStore store,
               DownloadConnection.Factory connectionFactory,
               DownloadOutputStream.Factory outputStreamFactory,
               ProcessFileStrategy processFileStrategy, DownloadStrategy downloadStrategy); DownloadDispatcher downloadDispatcher(); CallbackDispatcher callbackDispatcher(); BreakpointStore breakpointStore(); DownloadConnection.Factory connectionFactory(); DownloadOutputStream.Factory outputStreamFactory(); ProcessFileStrategy processFileStrategy(); DownloadStrategy downloadStrategy(); Context context(); void setMonitor(@Nullable DownloadMonitor monitor); @Nullable DownloadMonitor getMonitor(); static OkDownload with(); static void setSingletonInstance(@NonNull OkDownload okDownload);  }### Answer:
@Test(expected = IllegalStateException.class) public void with_noValidContext() { OkDownloadProvider.context = null; OkDownload.singleton = null; OkDownload.with(); }
@Test public void with_valid() { OkDownloadProvider.context = mock(Context.class); OkDownload.singleton = null; assertThat(OkDownload.with()).isNotNull(); }