Honestly I would just remove this private ctor. I understand what you are trying to do here, but the point of this file is really to show an example usage of running KMeans in Java. Other boilerplate code (even if they are for better software engineering practice) is just a distraction & extra complexity for readers to understand the code.