Java Utililty Methods List Range

List of utility methods to do List Range

Description

The list of methods to do List Range are organized into topic(s).

Method

doublegetRange(List numbers)
Returns the difference between the maximum and the minimum of a list of Doubles.

return getMax(numbers) - getMin(numbers);
ListgetRange(List list, int start)
Gets all elements from a list starting from the given index.
if (start >= list.size()) {
    return new ArrayList<>();
return list.subList(start, list.size());
ListgetRange(List list, int start, int count)
Get a range from a list based on start and count parameters in a safe way.
if (start >= list.size() || count <= 0) {
    return new ArrayList<>();
} else if (start < 0) {
    start = 0;
int end = Math.min(list.size(), start + count);
return list.subList(start, end);