make it simple for us to specify computations that need to loop through the elements of list to guarantee that node list supports the above methodsfor examplewe could add this method to the position list interfaceas shown in code fragment in this casewe would also want to state that position list extends iterable thereforelet us assume that our array lists and node lists lists support the iterator(method code fragment adding the iterator method to the position list interface given such position list definitionwe could use an iterator returned by the iterator(method to create string representation of node listas shown in code fragment code fragment example of java iterator used to convert node list to string the java for-each loop