I have a class A that extends from B. B has method called doB().

In my test, I want to return A when doB() is called.

Class B:

```
public String doB() {
    return "B";
}

```

Class A:

```
public class A extends B {

    public String doA() {
        String A = doB();
        return A;
    }
}

```

In my unit test, I want to do something like:

```
@Mock
private A a;

@Test
public void test() {
    when(a.doB()).thenReturn("PASS");
    a.doB();
    //check if it is "PASS"
}

```

However, it doesn't intercept when it calls `doB()`. Is this possible? If not, what is the best way to test this?