protected void replaceJettyXmlIfItBelongsToADifferentVersion(File jettyConfig) throws IOException {
        if (Files.readString(jettyConfig.toPath(), UTF_8).contains(JETTY_CONFIG_VERSION)) return;
        replaceFileWithPackagedOne(jettyConfig);
    }
@Test
    public void shouldReplaceJettyXmlIfItDoesNotContainCorrespondingJettyVersionNumber(@TempDir Path temporaryFolder) throws IOException {
        Path jettyXml = Files.createFile(temporaryFolder.resolve("jetty.xml"));
        when(systemEnvironment.getJettyConfigFile()).thenReturn(jettyXml.toFile());

        String originalContent = "jetty-v6.2.3\nsome other local changes";
        Files.writeString(jettyXml, originalContent, UTF_8);
        jettyServer.replaceJettyXmlIfItBelongsToADifferentVersion(systemEnvironment.getJettyConfigFile());
        try (InputStream configStream = Objects.requireNonNull(getClass().getResourceAsStream("config/jetty.xml"))) {
            assertThat(Files.readString(jettyXml, UTF_8)).isEqualTo(new String(configStream.readAllBytes(), UTF_8));
        }
    }