code: public static Object getAttributeCaseChecked( SimpleFeature feature, String field ) {
          Object attribute = feature.getAttribute(field);
          if (attribute == null) {
              attribute = feature.getAttribute(field.toLowerCase());
              if (attribute != null)
                  return attribute;
              attribute = feature.getAttribute(field.toUpperCase());
              if (attribute != null)
                  return attribute;
  
              // alright, last try, search for it
              SimpleFeatureType featureType = feature.getFeatureType();
              field = findAttributeName(featureType, field);
              if (field != null) {
                  return feature.getAttribute(field);
              }
          }
          return attribute;
      }
docs: Getter for attributes of a feature.
  
  <p>If the attribute is not found, checks are done in non
  case sensitive mode.
  
  @param feature the feature from which to get the attribute.
  @param field the name of the field.
  @return the attribute or null if none found.