class CustomIterator<> implements Iterator<> { // Variable to retain current location information (a.k.a.: cursor) // constructor CustomIterator<>(CustomDataStructure obj) { // initialize cursor } // Checks if the next element exists public boolean hasNext() { } // moves the cursor/iterator to next element public T next() { } // Used to remove an element. Implement only if needed public void remove() { // Default throws UnsupportedOperationException. } }