### Question:
ConnectTrial { public long getInstanceLength() { return this.instanceLength; } ConnectTrial(@NonNull DownloadTask task, @NonNull BreakpointInfo info); void executeTrial(); long getInstanceLength(); boolean isAcceptRange(); boolean isChunked(); @Nullable String getResponseEtag(); @Nullable String getResponseFilename(); int getResponseCode(); boolean isEtagOverdue();  }### Answer:
@Test public void getInstanceLength() throws Exception { when(connected.getResponseHeaderField(CONTENT_RANGE)) .thenReturn("bytes 21010-47021/47022"); connectTrial.executeTrial(); assertThat(connectTrial.getInstanceLength()).isEqualTo(47022L); assertThat(connectTrial.isChunked()).isFalse(); when(connected.getResponseHeaderField(CONTENT_RANGE)) .thenReturn(null); connectTrial.executeTrial(); assertThat(connectTrial.getInstanceLength()).isEqualTo(CHUNKED_CONTENT_LENGTH); assertThat(connectTrial.isChunked()).isTrue(); }