private void checkNotEmptyClass(
                                    String  testString,
                                    boolean needsError,
                                    boolean ownMessage) {
        Set<ConstraintViolation<Object>> constraintViolations;
        Object                           notEmptyClass;
        String                           validationString;

        if (ownMessage) {
            notEmptyClass       = new NotEmptyClassOwnMessage(testString);
            validationString    = errorMessage;
        } else {
            notEmptyClass       = new NotEmptyClassDefaultMessage(testString);
            validationString    = NotEmpty.errorMessage;
        }
        constraintViolations = validator.validate(notEmptyClass);
        if (needsError) {
            assertEquals(constraintViolations.size(), 1);
            assertEquals(constraintViolations.iterator().next().getMessage(),
                         validationString);
        } else {
            assertTrue(constraintViolations.isEmpty());
        }
    }