List of utility methods to do Collection Element Get
Class> | findCommonElementType(Collection collection) Find the common element type of the given Collection, if any. if (isEmpty(collection)) { return null; Class<?> candidate = null; for (Object val : collection) { if (val != null) { if (candidate == null) { candidate = val.getClass(); ... |
T | getFirst(Collection get First if (collection.isEmpty()) return null; else return collection.iterator().next(); |
int | getLastIndex(final Collection> collection) Calculates the index of the last entry in the collection. if (isEmpty(collection)) { return 0; return collection.size() - 1; |