Design Patterns Java - Iterator Php

1) What have we got?

We have some "Collection" class which has some collection of elements.


import java.util.ArrayList;
import java.util.List;

public class Collection
{
    private List<String> elements = new ArrayList<>();

    public Collection addElement(String element)
    {
        elements.add(element);

        return this;
    }

    public Collection removeElement(String element)
    {
        elements.remove(element);

        return this;
    }
}




2) What is our goal?

We would like to client allow traversing elements but we don't want to give him access to inner structure(elements).