private Response assureAcceptJSON(IHTTPSession session){
  final Map<String,String> headers=session.getHeaders();
  if (!APPLICATION_JSON.equals(headers.get(ACCEPT_FIELD))) {
    return newFixedLengthResponse(Response.Status.NOT_ACCEPTABLE,MIME_PLAINTEXT,"set accept to application/json or remove it");
  }
 else {
    return null;
  }
}

private Response assureAcceptJSON ( IHTTPSession session ) { final Map < String , String > headers = session . getHeaders ( ) ; if ( ! APPLICATION_JSON . equals ( headers . get ( ACCEPT_FIELD ) ) ) { return newFixedLengthResponse ( Response . Status . NOT_ACCEPTABLE , MIME_PLAINTEXT , "set accept to application/json or remove it" ) ; } else { return null ; } }
ensures that the " accept " header is either set to json or empty
