Iterator is not a class, but an interface - that is, just a declaration of methods without their implementation. AbstractCollection is an abstract class, that is, a class that has abstract (again, without implementation) methods. The size() and iterator() methods you are interested in are abstract - that is, without "meat", without implementation. Therefore, it is not a redefinition, but writing them from scratch.
The declaration of your collection should be something like this:
public class MyCollection extends AbstractCollection { }
As soon as you write this, then any imputed IDE itself will add the skeletons required for the implementation of the methods. Well, then write.
If you want to use some Java API developments, then you need to inherit from a class that already inherits from AbstractCollection — say, ArrayList — where all these methods are already implemented and you can use the type via super.iterator () or look at the ArrayList sources and see how everything is done