public static <T> Map<Boolean, List<T>> split(List<T> list, int n) {
        return IntStream
                .range(0, list.size())
                .mapToObj(i -> new SimpleEntry<>(i, list.get(i)))
                .collect(partitioningBy(entry -> entry.getKey() < n, mapping(SimpleEntry::getValue, toList())));
    }
<b>(*) Split a list into two parts; the length of the first part is given</b>
java8/src/main/java/com/shekhargulati/ninetynine_problems/_01_lists/P17.java