public class ReassignInSupplier { public static void main(String[] args) { // A LazyConstant has no set method: the only way to give it a value is the supplier passed to of(). LazyConstant c = LazyConstant.of(() -> "x"); c.set("y"); } }