code: public static void checkNotEmpty(@Nullable String value, @NonNull String message) {
          if (value == null) {
              throw new NullPointerException(message);
          } else if (value.length() == 0) {
              throw new IllegalStateException(message);
          }
      }
docs: Checks that passed string is not null and not empty,
  throws {@link NullPointerException} or {@link IllegalStateException} with passed message
  if string is null or empty.
  
  @param value   a string to check
  @param message exception message if object is null