Is it possible to extend a class with no constructors in Java?

constructor, inheritance, java, mocking

Solution

A class with no constructors has an implicit public no-argument constructor and yes, as long as it's not final, it can be sub-classed.

If the class has only private constructors then no, it can't.

Problem

For unit testing purposes I'm trying to write a mock object of a class with no constructors. Is this even possible in Java, of is the class simply not extensible?

Original source