I was reading on this software engineering page about the use of static
methods. However, I'm confused, and maybe it's about the context in which it talks about static
. The idea is, that static is really bad for testing and shouldn't be used.
When creating immutable class, sometimes the constructor is private and a static factory is used to create the object. Even Java's own documentation supports the use of a factory when creating immutable objects.
A more sophisticated approach is to make the constructor private and construct instances in factory methods