I have a singleton like this.
public class BookingFactory { private final static BookingFactory instance; static { instance = new BookingFactor
Make the assertion in the constructor:
private BookingFactory() { if (instance != null) throw new IllegalStateException("Only one instance may be created"); System.out.println("Object is created."); }