@Test public void getIstance() { assertThat(singleton, notNullValue()); assertThat(singleton, equalTo(Singleton.getIstance())); assertThat(singleton, sameInstance(Singleton.getIstance())); assertThat(Singleton.getIstance(), notNullValue()); assertThat(Singleton.getIstance(), equalTo(Singleton.getIstance())); assertThat(Singleton.getIstance(), sameInstance(Singleton.getIstance())); }
public static Singleton getIstance() { if (istance == null) { istance = new Singleton(); } return istance; }
Singleton { public static Singleton getIstance() { if (istance == null) { istance = new Singleton(); } return istance; } }
Singleton { public static Singleton getIstance() { if (istance == null) { istance = new Singleton(); } return istance; } private  Singleton(); }
Singleton { public static Singleton getIstance() { if (istance == null) { istance = new Singleton(); } return istance; } private  Singleton(); static Singleton getIstance(); }
Singleton { public static Singleton getIstance() { if (istance == null) { istance = new Singleton(); } return istance; } private  Singleton(); static Singleton getIstance();  }