RemoteList implements List<E> { @Override public List<E> subList(int start, int end) { return (List<E>) remoteInvoke("subList", false, start, end); } RemoteList(String cacheName, Object key);  RemoteList(String cacheName, Object key, Factory<List<E>> listFactory);  RemoteList(NamedCache cache, Object key);  RemoteList(NamedCache cache, Object key, Factory<List<E>> listFactory); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] ts); @Override boolean add(E e); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> objects); @Override boolean addAll(Collection<? extends E> objects); @Override boolean addAll(int i, Collection<? extends E> objects); @Override boolean removeAll(Collection<?> objects); @Override boolean retainAll(Collection<?> objects); @Override void clear(); @Override E get(int i); @Override E set(int i, E e); @Override void add(int i, E e); @Override E remove(int i); @Override int indexOf(Object o); @Override int lastIndexOf(Object o); @Override ListIterator<E> listIterator(); @Override ListIterator<E> listIterator(int i); @Override List<E> subList(int start, int end); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testSublist() { RemoteList<Integer> l = new RemoteList<Integer>(cache, 1L); l.addAll(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); assertEquals(Arrays.asList(2, 3, 4, 5), l.subList(2, 6)); assertEquals(Arrays.asList(8, 9, 10), l.subList(8, 11)); }