code: @VisibleForTesting
  	static String doExtractResponse(int statusCode, HttpEntity entity) {
  		String message = null;
  
  		if (entity != null) {
  			try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
  				entity.writeTo(baos);
  				message = baos.toString("UTF-8");
  			}
  			catch (IOException ex) {
  				throw new SystemException(ex);
  			}
  		}
  
  		//if the response is in the 400 range, use IllegalArgumentException, which currently translates to a 400 error
  		if (statusCode>= HttpStatus.SC_BAD_REQUEST && statusCode < HttpStatus.SC_INTERNAL_SERVER_ERROR) {
  			throw new IllegalArgumentException("Status code: " + statusCode + " .  Error occurred. " +  message);
  		}
  		//everything else that's not in the 200 range, use SystemException, which translates to a 500 error.
  		if ((statusCode < HttpStatus.SC_OK) || (statusCode >= HttpStatus.SC_MULTIPLE_CHOICES)) {
  			throw new SystemException("Status code: " + statusCode + " .  Error occurred. " +  message);
  		} else {
  			return message;
  		}
  	}
docs: testable version of {@link ElasticSearchSchemaService#extractResponse(Response)}
  @param statusCode
  @param entity
  @return