code: public Map<String, String> filterAttributes(Collection<Form> schema,
              Map<String, String> attributes) {
  
          Map<String, String> filtered = new HashMap<String, String>();
  
          // Grab all attribute value strictly for defined fields
          for (Form form : schema) {
              for (Field field : form.getFields()) {
  
                  // Pull the associated attribute value from given map
                  String attributeName = field.getName();
                  String attributeValue = attributes.get(attributeName);
  
                  // Include attribute value within filtered map only if
                  // (1) defined and (2) present within provided map
                  if (attributeValue != null)
                      filtered.put(attributeName, attributeValue);
  
              }
          }
  
          return filtered;
  
      }
docs: Filters the given map of attribute name/value pairs, producing a new
  map containing only attributes defined as fields within the given schema.
  
  @param schema
  The schema whose fields should be used to filter the given map of
  attributes.
  
  @param attributes
  The map of attribute name/value pairs to filter.
  
  @return
  A new map containing only the attributes defined as fields within
  the given schema.