class MyCollection implements Collection {
public boolean isEmpty ()
{ return data.count() == 0; }
public int size ()
{ return data.count(); }
public void addElement (Object newElement)
{data.add(newElement); }
public boolean containsElement (Object test)
{ return data.find(test) != null; }
public Object findElement (Object test)
{ return data.find(test); }
private DataBox data = new DataBox();
}
DataBox is some collection that does not support the Collection
interface.
Adapters are often needed to connect software from different vendors.