PathCreator { private static String replace(final String path, final String type, final long replacement, final int pad) { String value = String.valueOf(replacement); if (pad > 0) { value = Strings.padStart(value, pad, '0'); } return replace(path, type, value); }    }
@Test void testReplace() { final String template = "someText_${type1}_someText_${feed}_someText_${type2}_someText"; final String result = PathCreator.replaceAll(template, attributeMap); LOGGER.info("result: {}}", result); assertThat(result).isEqualTo("someText_mytype1_someText_myFeed_someText_mytype2_someText"); }