Inspired by this post which argues that the required public default constructor violates encapsulation: https://blog.softwaremill.com/a-valid-java-bean-e12c68000010 Should be acceptable to try and and make non-accessible constructors accessible.