code: public static String normalize(String val) {
          if (val == null || val.trim().length() == 0) return null;
          return val.trim();
      }
docs: Normalizes the given string by trimming it if non-null and returning
  null if null or empty.
  
  @param val the string value to normalize.
  @return the normalized value.