You can create a concatenated Iterable
view in O(1) using one of Guava's Iterables.concat methods:
Iterable<T> combined = Iterables.concat(list1, list2);
This will allow you to iterate over all the elements of both lists as one object without copying any elements.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…