code: public static <T> T[] checkNonEmpty(T[] array, String name) {
          checkNotNull(array, name);
          checkPositive(array.length, name + ".length");
          return array;
      }
docs: Checks that the given argument is neither null nor empty.
  If it is, throws {@link NullPointerException} or {@link IllegalArgumentException}.
  Otherwise, returns the argument.