Design Patterns Java - Adapter Php

1) Where to begin ?

We have some application which uses some library called here "LibraryOne"


public interface LibraryOne
{
    void doAB();
}

public class LibraryOneImpl implements LibraryOne
{
    @Override
    public void doAB()
    {
        System.out.println("doing AB");
    }
}




And in Client we just call method from library "doAB"


public class Client
{
    public void doSomething(LibraryOne libraryOne)
    {
        libraryOne.doAB();
    }
}




2) What we want to change ?

We would like to use another library "LibraryTwo" which doing the same but defining another interface.


public interface LibraryTwo
{
    void doA();

    void doB();
}

public class LibraryTwoImpl implements LibraryTwo
{
    @Override
    public void doA()
    {
        System.out.println("Doing A part");
    }

    @Override
    public void doB()
    {
        System.out.println("Doing B part");
    }
}




"LibraryOne" was used in many places in whole system. We don't want to refactor so big amount of code everywhere where "LibraryOne" was used by replacing
method of "LibraryOne" with "LibraryTwo".

3) How we can resolve this issue ?

We use "Adapter" pattern, let's see how is this look in step2.