code: private static void validateClassAnnotations(
              Class<?> type, AnnotationCache cache, Set<Warning> warnings, Set<String> includedFields, Set<String> excludedFields) {
  
          boolean usesWithOnlyTheseFields = !includedFields.isEmpty();
          boolean usesWithIgnoredFields = !excludedFields.isEmpty();
          boolean hasNaturalId = cache.hasClassAnnotation(type, SupportedAnnotations.NATURALID);
          boolean hasSurrogateKey = warnings.contains(Warning.SURROGATE_KEY);
          boolean hasVersionedEntity = warnings.contains(Warning.IDENTICAL_COPY_FOR_VERSIONED_ENTITY);
  
          validate(hasNaturalId && usesWithOnlyTheseFields, "you can't use withOnlyTheseFields when fields are marked with @NaturalId.");
          validate(hasNaturalId && usesWithIgnoredFields, "you can't use withIgnoredFields when fields are marked with @NaturalId.");
          validate(hasNaturalId && hasSurrogateKey,
              "you can't suppress Warning.SURROGATE_KEY when fields are marked @NaturalId.");
          validate(hasNaturalId && hasVersionedEntity,
              "you can't suppress Warning.IDENTICAL_COPY_FOR_VERSIONED_ENTITY when fields are marked with @NaturalId.");
      }
docs: CHECKSTYLE: ignore VariableDeclarationUsageDistance for 8 lines.