boolean isMethodCorrect(ResolvedMethod m) {
        if (m.getReturnType()!=null) {
            log.error("The method {} is annotated with @SelfValidation but does not return void. It is ignored", m.getRawMember());
            return false;
        } else if (m.getArgumentCount() != 1 || !m.getArgumentType(0).getErasedType().equals(ViolationCollector.class)) {
            log.error("The method {} is annotated with @SelfValidation but does not have a single parameter of type {}",
                m.getRawMember(), ViolationCollector.class);
            return false;
        } else if (!m.isPublic()) {
            log.error("The method {} is annotated with @SelfValidation but is not public", m.getRawMember());
            return false;
        }
        return true;
    }
@Test
    @SuppressWarnings("Slf4jFormatShouldBeConst")
    void privateIsNotAccepted() throws NoSuchMethodException {
        assertThat(selfValidatingValidator.isMethodCorrect(
                getMethod("validateFailPrivate", ViolationCollector.class)))
                .isFalse();

        verify(log).error("The method {} is annotated with @SelfValidation but is not public",
            InvalidExample.class.getDeclaredMethod("validateFailPrivate", ViolationCollector.class));
    }