{
Greeting greeting = new Greeting();
greeting.setMessage("Hello there!");
greeting.setTone(Tone.FRIENDLY);
final SubgreetingsRequestBuilders builders = new SubgreetingsRequestBuilders(requestOptions);
//POST
CreateIdRequest<Long, Greeting> createRequest = builders.create().input(greeting).build();
Response<IdResponse<Long>> response = REST_CLIENT.sendRequest(createRequest).getResponse();
Assert.assertNull(response.getHeader(RestConstants.HEADER_CONTENT_TYPE));
long id = response.getEntity().getId();
@SuppressWarnings("deprecation")
String stringId = response.getId();
Assert.assertEquals(id, Long.parseLong(stringId));
//GET again to verify that the create has worked.
Request<Greeting> getRequest = builders.get().id(id).build();
Response<Greeting> getResponse = REST_CLIENT.sendRequest(getRequest).getResponse();
Greeting responseGreeting = getResponse.getEntity();
Assert.assertEquals(responseGreeting.getMessage(), greeting.getMessage());
Assert.assertEquals(responseGreeting.getTone(), greeting.getTone());