code: public static String nonBlank(final String input) {
          if (null == input || "".equals(input.trim())) {
              return null;
          } else {
              return input.trim();
          }
      }
docs: Return null if the input is null or empty or whitespace, otherwise return the input string trimmed.