public static void checkNotNullOrEmpty(String parameter, String exceptionMessage) {
    if (parameter == null) {
      throw new NullPointerException(exceptionMessage);
    } else if (parameter.length() == 0) {
      throw new IllegalArgumentException(exceptionMessage);
    }
  }
Check whether the given String is null or empty and throw IllegalArgumentException if so.

@param parameter The string parameter to check.
@param exceptionMessage The IllegalArgumentException message to use if null or empty.
ambry-utils/src/main/java/com/github/ambry/utils/Utils.java