i.e. two classes:
class A{
public int getValue(){
return 5;
}
}
class B{
public int getValue(){
A a = new A();
return a.getValue();
}
}
Now I want to write a test for class B, but I want to mock class A for that test. The question is: how?
(This snippet is only a simpler version of my problem, please don't take care returning 5 or smth)