private static JsonObject getJsonError(OperationResult operationResult) {
    JsonObject jsonObject = new JsonObject();
    jsonObject.addProperty("errorIdentification", operationResult.getErrorIdentification());
    jsonObject.addProperty("errorDescription", operationResult.getErrorDescription());

    return jsonObject;
  }
  private static Object getJsonObject(OperationResult operationResult) {
    if (operationResult.isSucess()) {
      return getJsonSuccess(operationResult);
    }

    return getJsonError(operationResult);
  }
 private static Object getJsonSuccess(OperationResult operationResult) {
   return operationResult.getEntity();
 }