This isn't the actual class since I think the problem might be easier to understand with less clutter. The actual class is Minecraft related, but enough print statements to make sure stuff is running has made me fairly confident its not a minecraft problem. I'll send them if it would be helpful, though.
public class Example {
private Integer n = null;
public void setN(Integer n) {
System.out.println(n == null); // prints false
this.n = n;
}
public void init() {
Runnable runnable = () -> {
System.out.println(this.n == null); // prints true
};
// I know that when the runnable is actually called setN() has been run
doStuffWith(runnable);
}```