android/guava/src/com/google/common/collect/Lists.java
static <E> List<E> subListImpl(final List<E> list, int fromIndex, int toIndex) {
    List<E> wrapper;
    if (list instanceof RandomAccess) {
      wrapper =
          new RandomAccessListWrapper<E>(list) {
            @Override
            public ListIterator<E> listIterator(int index) {
              return backingList.listIterator(index);
            }

            private static final long serialVersionUID = 0;
          };
    } else {
      wrapper =
          new AbstractListWrapper<E>(list) {
            @Override
            public ListIterator<E> listIterator(int index) {
              return backingList.listIterator(index);
            }

            private static final long serialVersionUID = 0;
          };
    }
    return wrapper.subList(fromIndex, toIndex);
  }
static <E> List<E> subListImpl(final List<E> list, int fromIndex, int toIndex) {
    List<E> wrapper;
    if (list instanceof RandomAccess) {
      wrapper =
          new RandomAccessListWrapper<E>(list) {
            @Override
            public ListIterator<E> listIterator(int index) {
              return backingList.listIterator(index);
            }

            private static final long serialVersionUID = 0;
          };
    } else {
      wrapper =
          new AbstractListWrapper<E>(list) {
            @Override
            public ListIterator<E> listIterator(int index) {
              return backingList.listIterator(index);
            }

            private static final long serialVersionUID = 0;
          };
    }
    return wrapper.subList(fromIndex, toIndex);
  }
static < E > List < E > subListImpl ( final List < E > list , int fromIndex , int toIndex ) { List < E > wrapper ; if ( list instanceof RandomAccess ) { wrapper = new RandomAccessListWrapper < E > ( list ) { @ Override public ListIterator < E > listIterator ( int index ) { return backingList . listIterator ( index ) ; } private static final long serialVersionUID = 0 ; } ; } else { wrapper = new AbstractListWrapper < E > ( list ) { @ Override public ListIterator < E > listIterator ( int index ) { return backingList . listIterator ( index ) ; } private static final long serialVersionUID = 0 ; } ; } return wrapper . subList ( fromIndex , toIndex ) ; }
An implementation of {@link List#subList(int, int)}.
An implementation of {