I want to initialize a static final variable of a class differently when it is mocked, and when it is not. Is there any way to do this?
Something like :
public class Test {
private static final Integer a = getA();
private static Integer getA() {
if(mocked) {
return x;
} else {
return y;
}
}