public static <T> T get(final List<T> list, final int index) { if (index >= VerifyArgument.notNull(list, "list").size() || index < 0) { throw Error.indexOutOfRange(index); } return list.get(index); }
public static <T> T get(final List<T> list, final int index) { if (index >= VerifyArgument.notNull(list, "list").size() || index < 0) { throw Error.indexOutOfRange(index); } return list.get(index); }
public static <T> T get(final List<T> list, final int index) { if (index >= VerifyArgument.notNull(list, "list").size() || index < 0) { throw Error.indexOutOfRange(index); } return list.get(index); }
public static <T> T get(final Iterable<T> collection, final int index) { if (VerifyArgument.notNull(collection, "collection") instanceof List<?>) { return get((List<T>) collection, index); } int i = 0; for (final T item : collection) { if (i++ == index) { return item; } } throw Error.indexOutOfRange(index); }
public static <T> T get(final Iterable<T> collection, final int index) { if (VerifyArgument.notNull(collection, "collection") instanceof List<?>) { return get((List<T>) collection, index); } int i = 0; for (final T item : collection) { if (i++ == index) { return item; } } throw Error.indexOutOfRange(index); }
public static <T> T get(final Iterable<T> collection, final int index) { if (VerifyArgument.notNull(collection, "collection") instanceof List<?>) { return get((List<T>) collection, index); } int i = 0; for (final T item : collection) { if (i++ == index) { return item; } } throw Error.indexOutOfRange(index); }