Singleton pattern in java
Although Singletons are not encouraged because it can make it difficult to test it's clients, we can create it in three ways.
- With Public final filed
- With Static Factory
- With Enum
