### Question:
BreakpointRemoteCheck { @NonNull public ResumeFailedCause getCauseOrThrow() { if (failedCause == null) { throw new IllegalStateException("No cause find with resumable: " + resumable); } return this.failedCause; } BreakpointRemoteCheck(@NonNull DownloadTask task,
                                 @NonNull BreakpointInfo info); @Override String toString(); @Nullable ResumeFailedCause getCause(); @NonNull ResumeFailedCause getCauseOrThrow(); boolean isResumable(); boolean isAcceptRange(); long getInstanceLength(); void check();  }### Answer:
@Test(expected = IllegalStateException.class) public void getCauseOrThrown() throws Exception { final ResumeFailedCause failedCause = mock(ResumeFailedCause.class); check.failedCause = failedCause; assertThat(check.getCauseOrThrow()).isEqualTo(failedCause); check.failedCause = null; check.getCauseOrThrow(); }