code: function withProperties(validatedObject, validatedProperties) {
    notNil(validatedObject);
  
    const undefinedProperties = _.filter(validatedProperties, function(property) {
      return !validatedObject.hasOwnProperty(property);
    });
  
    if (!_.isEmpty(undefinedProperties)) {
      throw new ValidationError("Validated object doesn't have properties: " + undefinedProperties);
    }
    return validatedObject;
  }
docs: Checks object to have at least a given set of properties defined
  @param {*} validatedObject
  @param {String[]} validatedProperties - names of properties which existence should be checked
  @returns {*} validatedObject