### Question:
RevisionPattern { public RevisionPattern clone(Function<String, String> replacementFunction) { return new RevisionPattern( replacementFunction.apply(pattern) ); } @ConstructorProperties({"pattern"})  RevisionPattern(String pattern); boolean isValidBuildName(String buildName); OptionalLong extractRevision(String buildName); RevisionPattern clone(Function<String, String> replacementFunction);  }### Answer:
@Test public void clone_no_replacement() { RevisionPattern r = new RevisionPattern("11.8.4*-{revision}"); assertEquals("11.8.4*-{revision}", r.clone(value -> StringUtils.replace(value, "${sourceName}", "1.0")).getPattern()); }
@Test public void clone_replacement() { RevisionPattern r = new RevisionPattern("${sourceName}*-{revision}"); assertEquals("1.0*-{revision}", r.clone(value -> StringUtils.replace(value, "${sourceName}", "1.0")).getPattern()); }