@Test public void constructorShouldBePrivate() { PrivateConstructorChecker.forClass(People.class) .expectedTypeOfException(AssertionError.class) .expectedExceptionMessage("No instances.") .check(); }
@Test public void constructorShouldBePrivateAndThrowException() { PrivateConstructorChecker.forClass(Checks.class) .expectedTypeOfException(IllegalStateException.class) .expectedExceptionMessage("No instances please.") .check(); }