LazyInit is a helper class that provides lazy initlization of singleton object feature.
Example:
Template is the object I need to create.
The LazyInit accepts Supplier as an argument.
LazyInit<Template> lazy = LazyInit.of(Template::new);
The lazy object is thread safe and the Template object returned by the lazy instance is always same.
Template template = lazy.getOrCreate();
template.print();