Here you can find the source of sublist(LinkedHashSet
public static <T> List<T> sublist(LinkedHashSet<T> base, int start, int count)
//package com.java2s; /*/*from w ww. ja va2 s . c o m*/ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * Copyright (c) 2013, MPL CodeInside http://codeinside.ru */ import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; public class Main { public static <T> List<T> sublist(LinkedHashSet<T> base, int start, int count) { Iterator<T> iterator = base.iterator(); int index = 0; final List<T> result = new ArrayList<T>(); while (iterator.hasNext() && index < (start + count)) { T next = iterator.next(); if (index < start) { index++; continue; } index++; result.add(next); } return result; } }