### Question:
BreakpointLocalCheck { @NonNull public ResumeFailedCause getCauseOrThrow() { if (!infoRight) { return INFO_DIRTY; } else if (!fileExist) { return FILE_NOT_EXIST; } else if (!outputStreamSupport) { return OUTPUT_STREAM_NOT_SUPPORT; } throw new IllegalStateException("No cause find with dirty: " + dirty); } BreakpointLocalCheck(@NonNull DownloadTask task, @NonNull BreakpointInfo info,
                                long responseInstanceLength); boolean isDirty(); @NonNull ResumeFailedCause getCauseOrThrow(); boolean isInfoRightToResume(); boolean isOutputStreamSupportResume(); boolean isFileExistToResume(); void check(); @Override String toString();  }### Answer:
@Test public void getCauseOrThrow_infoDirty() { check.infoRight = false; check.fileExist = true; check.outputStreamSupport = true; assertThat(check.getCauseOrThrow()).isEqualTo(INFO_DIRTY); }
@Test public void getCauseOrThrow_fileNotExist() { check.infoRight = true; check.fileExist = false; check.outputStreamSupport = true; assertThat(check.getCauseOrThrow()).isEqualTo(FILE_NOT_EXIST); }
@Test public void getCauseOrThrow_outputStreamNotSupport() { check.infoRight = true; check.fileExist = true; check.outputStreamSupport = false; assertThat(check.getCauseOrThrow()).isEqualTo(OUTPUT_STREAM_NOT_SUPPORT); }
@Test(expected = IllegalStateException.class) public void getCauseOrThrow_notDirty() { check.infoRight = true; check.fileExist = true; check.outputStreamSupport = true; check.getCauseOrThrow(); }