I\'m having difficulty finding a way to set a static field of a class. It\'s basically like this:
public class Foo{
// ...
private static B b = null;
You can use getAllStaticFields
and try to set them
Example:
YourFieldClass newValue;
final Set fields = Whitebox.getAllStaticFields(YourClass.class);
for (final Field field : fields) {
if (YourFieldClass.class.equals(field.getType())) { // or check by field name
field.setAccessible(true);
field.set(YourClass.class, newValue);
} }