I\'m looking for something to achieve the following:
String s = \"hello {}!\"; s = generate(s, new Object[]{ \"world\" }); assertEquals(s, \"hello world!\");
If you can change the format of your placeholder, you could use String.format(). If not, you could also replace it as pre-processing.
String.format()
String.format("hello %s!", "world");
More information in this other thread.