It won't get unloaded so long as references linger.
Regardless, globals are bad, and a strong code smell. If your only complaint with Java is that it doesn't properly support a terrible feature, then I guess you don't have any valid issues.
But they're not globals. They disappear when references are lost. Globals don't do that.
And you can totally test globals. I do it all the time. Any function that has a side effect is basically doing the same thing as a function that modifies a global.
2
u/scootstah Jan 08 '18
Uncomplete example for brevity. Perhaps I gave you too much credit to figure it out.