### Question:
RequestBody implements AnyRequestModifier { @Override public void applyTo(ServerDriverHttpUriRequest request) { HttpUriRequest internalRequest = request.getHttpUriRequest(); if (!(internalRequest instanceof HttpEntityEnclosingRequest)) { return; } HttpEntityEnclosingRequest entityRequest = (HttpEntityEnclosingRequest) internalRequest; entityRequest.setHeader("Content-type", contentType); entityRequest.setEntity(new StringEntity(content, createContentType(contentType))); } RequestBody(String content, String contentType); @Deprecated String getContent(); @Deprecated String getContentType(); @Override void applyTo(ServerDriverHttpUriRequest request);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void applyToThrowsExceptionWhenContentTypeIsInvalid() throws Exception { HttpPost request = new HttpPost(); RequestBody body = new RequestBody("content", "invalid;;;;"); body.applyTo(new ServerDriverHttpUriRequest(request)); }
@Test public void applyToHandlesRequestWhichCannotHaveBody() { HttpUriRequest request = new HttpGet(); RequestBody body = new RequestBody("content", "contentType"); body.applyTo(new ServerDriverHttpUriRequest(request)); }