public static void checkNotNullAndNotEmpty(String arg, String argName) {
    checkNotNull(arg, argName);
    checkArgument(
        !arg.isEmpty(),
        "'%s' must not be empty.",
        argName);
  }
@Test
  public void testCheckListNotNullAndNotEmpty() throws Exception {
    // Should not throw.
    Validate.checkNotNullAndNotEmpty(VALID_LIST, "list");

    // Verify it throws.
    ExceptionAsserts.assertThrows(
        IllegalArgumentException.class,
        "'list' must not be null",
        () -> Validate.checkNotNullAndNotEmpty(NULL_LIST, "list"));

    ExceptionAsserts.assertThrows(
        IllegalArgumentException.class,
        "'list' must have at least one element",
        () -> Validate.checkNotNullAndNotEmpty(EMPTY_LIST, "list"));
  }