String s = "hello %s!"; s = String.format(s, "world"); assertEquals(s, "hello world!"); // should be true