@Test
void testReplaceFileName(@TempDir Path tempDir) {

    final PathCreator pathCreator = new PathCreator(() -> tempDir);
    assertThat(pathCreator.replaceFileName("${fileStem}.txt", "test.tmp")).isEqualTo("test.txt");
    assertThat(pathCreator.replaceFileName("${fileStem}", "test.tmp")).isEqualTo("test");
    assertThat(pathCreator.replaceFileName("${fileStem}", "test")).isEqualTo("test");
    assertThat(pathCreator.replaceFileName("${fileExtension}", "test.tmp")).isEqualTo("tmp");
    assertThat(pathCreator.replaceFileName("${fileExtension}", "test")).isEqualTo("");
    assertThat(pathCreator.replaceFileName("${fileName}.txt", "test.tmp")).isEqualTo("test.tmp.txt");
}