Design Patterns Java - Adapter Php

1) What has changed?

Instead of inheritance we used aggregation of object "LibraryTwo" in "Adapter"

2) What hasn't changed?


public class Adapter implements LibraryOne
{
    private LibraryTwo libraryTwo;

    public Adapter(LibraryTwo libraryTwo)
    {
        this.libraryTwo = libraryTwo;
    }

    @Override
    public void doAB()
    {
        libraryTwo.doA();
        libraryTwo.doA();
    }
}




Adapter is still type of "LibraryOne" it's necessary condition in order to still use clients without any changes.