Support the subscript operator with an ObjectRange for a long array

@param array a long array
@param range an ObjectRange indicating the indices for the items to retrieve
@return list of the retrieved longs
@since 1.0
161870
@SuppressWarnings("unchecked")
    public static List<Long> getAt(long[] array, ObjectRange range) {
        return primitiveArrayGet(array, range);
    }
471439
@SuppressWarnings("unchecked")
    public static List<Short> getAt(short[] array, Range range) {
        return primitiveArrayGet(array, range);
    }
438477
public static CharRanges withRanges(int... ranges) {
    if ((ranges.length & 1) != 0) { throw new IllegalArgumentException(); }
    for (int i = 1; i < ranges.length; ++i) {
      if (ranges[i] <= ranges[i - 1]) {
        throw new IllegalArgumentException(ranges[i] + " > " + ranges[i - 1]);
      }
    }
    return new CharRanges(ranges);
  }
1258598
public List<String> range(int start,int end){
        try {    		
        	return new ArrayList<>(getJedisCommands(groupName).zrange(key, start, end));
    	} finally{
			getJedisProvider(groupName).release();
		}
	}
152789
public void setRangesOnIndexedValues(java.util.Collection<ObjectAttributeRange> rangesOnIndexedValues) {
        if (rangesOnIndexedValues == null) {
            this.rangesOnIndexedValues = null;
            return;
        }

        this.rangesOnIndexedValues = new java.util.ArrayList<ObjectAttributeRange>(rangesOnIndexedValues);
    }
1169816
function RangeIterator(range) {
	this.range = range;
	if (range.collapsed)
		return;

//[TODO] ensure this works
	// get anchors
	var root = range.commonAncestorContainer;
	this._next = range.startContainer == root && !DOMUtils.isDataNode(range.startContainer) ?
	    range.startContainer.childNodes[range.startOffset] :
	    DOMUtils.findClosestAncestor(root, range.startContainer);
	this._end = range.endContainer == root && !DOMUtils.isDataNode(range.endContainer) ?
	    range.endContainer.childNodes[range.endOffset] :
	    DOMUtils.findClosestAncestor(root, range.endContainer).nextSibling;
}
493294
@SuppressWarnings("unchecked")
    public static List<Short> getAt(short[] array, ObjectRange range) {
        return primitiveArrayGet(array, range);
    }
983311
public Query range(ByteStringRange range) {
    RowRange.Builder rangeBuilder = RowRange.newBuilder();

    switch (range.getStartBound()) {
      case OPEN:
        rangeBuilder.setStartKeyOpen(range.getStart());
        break;
      case CLOSED:
        rangeBuilder.setStartKeyClosed(range.getStart());
        break;
      case UNBOUNDED:
        rangeBuilder.clearStartKey();
        break;
      default:
        throw new IllegalStateException("Unknown start bound: " + range.getStartBound());
    }

    switch (range.getEndBound()) {
      case OPEN:
        rangeBuilder.setEndKeyOpen(range.getEnd());
        break;
      case CLOSED:
        rangeBuilder.setEndKeyClosed(range.getEnd());
        break;
      case UNBOUNDED:
        rangeBuilder.clearEndKey();
        break;
      default:
        throw new IllegalStateException("Unknown end bound: " + range.getEndBound());
    }

    builder.getRowsBuilder().addRowRanges(rangeBuilder.build());

    return this;
  }
208111
public static List primitiveArrayToList(Object array) {
        int size = Array.getLength(array);
        List list = new ArrayList(size);
        for (int i = 0; i < size; i++) {
            Object item = Array.get(array, i);
            if (item != null && item.getClass().isArray() && item.getClass().getComponentType().isPrimitive()) {
                item = primitiveArrayToList(item);
            }
            list.add(item);
        }
        return list;
    }
784231
public static long[] asLongArray(Collection collection) {
        long[] result = new long[collection.size()];
        int i = 0;
        for (Object c : collection) {
            result[i++] = asLong(c);
        }
        return result;
    }
649519
public INDArray getRange() {
        if (range == null) {
            try (MemoryWorkspace ws = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {
                range = upper.sub(lower);
            }
        }
        return range;
    }
655595
public Range[] minus(Range that){
        Range split[] = split(that);
        if(split[0]==null && split[2]==null)
            return new Range[0];
        if(split[0]!=null && split[2]!=null)
            return new Range[]{ split[0], split[2] };

        return new Range[]{ split[0]!=null ? split[0] : split[2] };
    }
207395
public static LongStream rangeValues(Protos.Value.Range range) {
		checkNotNull(range);
		return LongStream.rangeClosed(range.getBegin(), range.getEnd());
	}
875780
private Long[] convertObjectArrToLongArr(final Object[] list) {
        final Long[] toReturn = new Long[list.length];
        for(int i = 0; i < list.length; i++) {
            toReturn[i] = ((Number)list[i]).longValue();
        }
        return toReturn;
    }
1094771
public static <T> T[] sub(T[] array, int start, int end) {
		int length = length(array);
		if (start < 0) {
			start += length;
		}
		if (end < 0) {
			end += length;
		}
		if (start == length) {
			return newArray(array.getClass().getComponentType(), 0);
		}
		if (start > end) {
			int tmp = start;
			start = end;
			end = tmp;
		}
		if (end > length) {
			if (start >= length) {
				return newArray(array.getClass().getComponentType(), 0);
			}
			end = length;
		}
		return Arrays.copyOfRange(array, start, end);
	}
43129
public static List<Long> lengths(final Iterable<Range<Long>> ranges) {
        checkNotNull(ranges);
        List<Long> lengths = new ArrayList<Long>();
        for (Range<Long> range : ranges) {
            lengths.add(length(range));
        }
        return lengths;
    }
864280
public Object getArrayElement(Object o, int index) throws IndexOutOfBoundsException {
        if (o instanceof List)
            return ((List)o).get(index);
        return Array.get(o,index);
    }