public class SingletonTest {
 private final int foo;
 
 private static SingletonTest instance = null;

 private SingletonTest(int foo) {
  this.foo = foo; //←これ
 }

 public static SingletonTest getInstance(int foo) {
  return (instance == null) ? instance = new SingletonTest(foo) : instance;
 }

 public static SingletonTest getInstance() {
  return (instance == null) ? newInstance(1) : instance;
 }
}