You can test a private constructor by using Reflection. Insert the following code in your unit test class:
import java.lang.reflect.Constructor; @Test public void privateConstructorTest() throws Exception { Constructor<MyClass> constructor = MyClass.class.getDeclaredConstructor(); assertEquals(constructor.isAccessible(), false); constructor.setAccessible(true); constructor.newInstance((Object[]) null); }