### Question:
KsqlVersionCheckerResponseHandler implements ResponseHandler { @Override public void handle(HttpResponse response) { int statusCode = response.getStatusLine().getStatusCode(); try { if (statusCode == HttpStatus.SC_OK && response.getEntity().getContent() != null) { String content = EntityUtils.toString(response.getEntity()); if (content.length() > 0) { log.warn(content.toString()); } } } catch (IOException e) { log.error("Error while parsing the Version check response ", e); } } KsqlVersionCheckerResponseHandler(); @VisibleForTesting  KsqlVersionCheckerResponseHandler(Logger log); @Override void handle(HttpResponse response);  }### Answer:
@Test public void testHandle() throws IOException { HttpResponse response = mock(HttpResponse.class); StatusLine statusLine = mock(StatusLine.class); HttpEntity entity = mock(HttpEntity.class); Logger log = mock(Logger.class); Header header = mock(Header.class); expect(response.getStatusLine()).andReturn(statusLine).once(); expect(statusLine.getStatusCode()).andReturn(HttpStatus.SC_OK).once(); expect(response.getEntity()).andReturn(entity).times(2); final ByteArrayInputStream bais = new ByteArrayInputStream("yolo".getBytes()); expect(entity.getContent()).andReturn(bais).times(2); expect(entity.getContentType()).andReturn(header).times(1); expect(header.getElements()).andReturn(new HeaderElement[]{}); expect(entity.getContentLength()).andReturn(4L).times(2); log.warn("yolo"); expectLastCall().once(); replay(response, statusLine, entity, header, log); KsqlVersionCheckerResponseHandler kvcr = new KsqlVersionCheckerResponseHandler(log); kvcr.handle(response); verify(response, statusLine, entity, header, log); }