I have a simple class like this
public class Version {
public static final Version SOME_VER = new Version("1.2.3");
...
}
Now, up to recently I was able to change the SOME_VER field via reflection in a junit test, but due to the changes regarding reflection in Java 12 this is not possible anymore.
I know I could use powermock or instrumentation to change the class, but for several reasons do not want that.
Is there a way a different way to change the SOME_VER in a test? Or how would I change the Version class, so I can have a different version SOME_VER set on class creation?