Define a method named print(DataStructureIterator iterator). Invoke this method with an instance of the class EvenIterator so that it performs the same function as the method printEven.
Invoke the method print(DataStructureIterator iterator) so that it prints elements that have an odd index value. Use an anonymous class as the method's argument instead of an instance of the interface DataStructureIterator.
Define a method named print(java.util.function.Function<Integer, Boolean> iterator) that performs the same function as print(DataStructureIterator iterator). Invoke this method with a lambda expression to print elements that have an even index value. Invoke this method again with a lambda expression to print elements that have an odd index value.
Define two methods so that the following two statements print elements that have an even index value and elements that have an odd index value: DataStructure ds = new DataStructure() // ... ds.print(DataStructure::isEvenIndex); ds.print(DataStructure::isOddIndex);