ANONYMOUS wrote:
> Hi I keep running my code and getting this error. I don't know how to fix it without changing the test CountingDoubleEndedIterator itself. If you have any idea or had the same issue, a hint would be greatly appreciated, thank you.
>
> Running tests
> itertools
> ItertoolsTest
> testTake: OK
> Exception in thread "main" java.lang.Error: Unresolved compilation problem:
> The type CountingDoubleEndedIterator<T> must implement the inherited abstract method DoubleEndedIterator<T>.hasPrevious()
The `DoubleEndedIterator` as provided has no `hasPrevious()` method. I can only assume you have added this yourself. There is no reason to modify the `DoubleEndedIterator` interface, and you should not do so. You are under explicit instruction that any modifications you make to the test will be discarded, and modifying `DoubleEndedIterator` in this fashion will cause the tests to fail, and will mean you do not get the marks.
I recommend you put `DoubleEndedIterator` back the way it was provided, and fix the rest of your code.
What motivated you to add a method to the `DoubleEndedIterator` interface? What is your `hasPrevious()` method even meant to do?