@VisibleForTesting
    static String generateLogUrl(String pattern, String jobId, String taskManagerId) {
        String generatedUrl = pattern.replaceAll("<jobid>", jobId);
        if (null != taskManagerId) {
            generatedUrl = generatedUrl.replaceAll("<tmid>", taskManagerId);
        }
        return generatedUrl;
    }
@Test
    void testGenerateTaskManagerLogUrl() {
        final String pattern = "http://localhost/<jobid>/tm/<tmid>/log";
        final String jobId = "jobid";
        final String taskManagerId = "tmid";

        final String generatedUrl =
                GeneratedLogUrlHandler.generateLogUrl(pattern, jobId, taskManagerId);

        assertThat(pattern.replace("<jobid>", jobId).replace("<tmid>", taskManagerId))
                .isEqualTo(generatedUrl);
    }