I am reviewing following code where I am confused with blank constructor for the FlowSpaceImpl class. Since constructor is private and FlowSpaceImpl instance is set to be static and private its obvious developer wants only one instance for this class. But When new FlowSpaceImpl() is call how the object for FlowSpaceImpl class will be initialized at first place. For code review you can look at FlowSpaceImpl implementation
public class FlowSpaceImpl implements FlowSpace {
private static FlowSpaceImpl instance = null;
private FlowSpaceImpl() {}
private static FlowSpaceImpl getInstance() {
if (instance == null)
instance = new FlowSpaceImpl();
return instance;
}
}