boolean (@NotNull Collection<BuilderInfo> builderInfos, @NotNull ProblemSink problemSink) { final Optional<BuilderInfo> anyBuilderDefaultAndSingulars = builderInfos.stream() .filter(BuilderInfo::hasBuilderDefaultAnnotation) .filter(BuilderInfo::hasSingularAnnotation).findAny(); anyBuilderDefaultAndSingulars.ifPresent(builderInfo -> { problemSink.addErrorMessage("inspection.message.builder.default.singular.cannot.be.mixed"); } ); final Optional<BuilderInfo> anyBuilderDefaultWithoutInitializer = builderInfos.stream() .filter(BuilderInfo::hasBuilderDefaultAnnotation) .filter(BuilderInfo::hasNoInitializer).findAny(); anyBuilderDefaultWithoutInitializer.ifPresent(builderInfo -> { problemSink.addErrorMessage("inspection.message.builder.default.requires.initializing.expression"); } ); return anyBuilderDefaultAndSingulars.isEmpty() || anyBuilderDefaultWithoutInitializer.isEmpty(); }