public static void assertThatClassIsUtility(Class<?> clazz) {
        final UtilityClassChecker checker = new UtilityClassChecker();
        if (!checker.isProperlyDefinedUtilityClass(clazz)) {
            final Description toDescription = new StringDescription();
            final Description mismatchDescription = new StringDescription();

            checker.describeTo(toDescription);
            checker.describeMismatch(mismatchDescription);
            final String reason =
                "\n" +
                "Expected: is \"" + toDescription.toString() + "\"\n" +
                "    but : was \"" + mismatchDescription.toString() + "\"";

            throw new AssertionError(reason);
        }
    }
@Test
    public void testNonPrivateConstructor() throws Exception {

        boolean gotException = false;
        try {
            assertThatClassIsUtility(NonPrivateConstructor.class);
        } catch (AssertionError assertion) {
            assertThat(assertion.getMessage(),
                       containsString("constructor that is not private"));
            gotException = true;
        }
        assertThat(gotException, is(true));
    }