public void checkJavaVersion() {
    Runtime.Version version = Runtime.version();
    if (version.compareTo(Runtime.Version.parse("17")) < 0) {
      LOG.warn(LOG_MESSAGE);
      String documentationLink = documentationLinkGenerator.getDocumentationLink("/analyzing-source-code/scanner-environment");
      analysisWarnings.addUnique(WARNING_MESSAGE_TEMPLATE.replace("{}", documentationLink));
    }
  }
@Test
  public void given_runtime11_should_log_message() {
    try (MockedStatic<Runtime> utilities = Mockito.mockStatic(Runtime.class)) {
      Runtime.Version version = Runtime.Version.parse("11");
      utilities.when(Runtime::version).thenReturn(version);

      underTest.checkJavaVersion();

      assertThat(logTester.getLogs(Level.WARN)).extracting(LogAndArguments::getRawMsg)
        .anyMatch(s -> s.contains(RuntimeJavaVersion.LOG_MESSAGE));
    }
  }