private void checkRequiredFields(SimpleObject simpleObject,String[] requiredFields){
  List<String> missingFields=new ArrayList<>();
  for (  String requiredField : requiredFields) {
    if (!simpleObject.containsKey(requiredField)) {
      missingFields.add(requiredField);
    }
  }
  if (!missingFields.isEmpty()) {
    throw new InvalidObjectDataException("JSON object lacks required fields: " + StringUtils.join(missingFields,","));
  }
}

private void checkRequiredFields ( SimpleObject simpleObject , String [ ] requiredFields ) { List < String > missingFields = new ArrayList < > ( ) ; for ( String requiredField : requiredFields ) { if ( ! simpleObject . containsKey ( requiredField ) ) { missingFields . add ( requiredField ) ; } } if ( ! missingFields . isEmpty ( ) ) { throw new InvalidObjectDataException ( "JSON object lacks required fields: " + StringUtils . join ( missingFields , "," ) ) ; } }
throws an exception if the given simpleobject is missing any required fields .
