List<Foo> foos = ... for (List<Foo> partition : Lists.partition(foos, n)) { // do something with partition }