@Test(dataProvider = "invalidIndexes", expectedExceptions = IllegalArgumentException.class) public void testValidateIndexInvalid(final int index, final int length) { ParamUtils.validateIndex(index, length); }
public static int validateIndex(final int index, final int length) { validate(index >= 0, () -> "index cannot be negative: " + index); validate(index < length, () -> "index out of bounds: " + index + ">" + (length - 1)); return index; }
ParamUtils { public static int validateIndex(final int index, final int length) { validate(index >= 0, () -> "index cannot be negative: " + index); validate(index < length, () -> "index out of bounds: " + index + ">" + (length - 1)); return index; } }
ParamUtils { public static int validateIndex(final int index, final int length) { validate(index >= 0, () -> "index cannot be negative: " + index); validate(index < length, () -> "index out of bounds: " + index + ">" + (length - 1)); return index; } private  ParamUtils(); }
ParamUtils { public static int validateIndex(final int index, final int length) { validate(index >= 0, () -> "index cannot be negative: " + index); validate(index < length, () -> "index out of bounds: " + index + ">" + (length - 1)); return index; } private  ParamUtils(); static void validate(final boolean condition, final Supplier<String> message); static int validateIndex(final int index, final int length); static T nonNull(final T object, final Supplier<String> message); static T nonNull(final T object); static T nonEmpty(final T collection, final Supplier<String> message); static T nonEmpty(final T collection); }
ParamUtils { public static int validateIndex(final int index, final int length) { validate(index >= 0, () -> "index cannot be negative: " + index); validate(index < length, () -> "index out of bounds: " + index + ">" + (length - 1)); return index; } private  ParamUtils(); static void validate(final boolean condition, final Supplier<String> message); static int validateIndex(final int index, final int length); static T nonNull(final T object, final Supplier<String> message); static T nonNull(final T object); static T nonEmpty(final T collection, final Supplier<String> message); static T nonEmpty(final T collection);  }