### Question:
ApiResponse { public boolean isSuccess() { return (httpResponseCode /100==2); } ApiResponse(int httpCode);  ApiResponse(int httpCode, Map<String, List<String>> headers); abstract void consumeResponse(InputStream responseBody); int getHttpResponseCode(); Map<String, List<String>> getHeaders(); boolean isSuccess(); boolean isUnauthorized();  }### Answer:
@Test public void isSuccess_shouldReturnTrueIfResponseCodeIsInThe200Range(){ assertThat(new TestApiResponse(200).isSuccess(), equalTo(true)); assertThat(new TestApiResponse(201).isSuccess(), equalTo(true)); assertThat(new TestApiResponse(299).isSuccess(), equalTo(true)); }
@Test public void isSuccess_shouldReturnFalseIfResponseCodeIsIn500Range() throws Exception { assertThat(new TestApiResponse(500).isSuccess(), equalTo(false)); assertThat(new TestApiResponse(501).isSuccess(), equalTo(false)); }