final List<Preference<Language>> acceptedLanguages = new ArrayList<Preference<Language>>();
acceptedLanguages.add(new Preference<Language>(Language.ENGLISH));
final ClientInfo clientInfo = new ClientInfo();
clientInfo.setAcceptedLanguages(acceptedLanguages);
final Request request = new Request(Method.POST, createReference(
HttpHeaderTestService.class, "language"));
request.setClientInfo(clientInfo);
request.setEntity(new StringRepresentation("entity", Language.ENGLISH));
final Response response = accessServer(request);
assertEquals(Status.SUCCESS_OK, response.getStatus());
assertEquals("en", response.getEntity().getText());
}