@Test public static void testFormatterForArray() { Assert.assertEquals(StringFunctions.formatterForArray("Hello %s").apply(new Object[] { "World" }), "Hello World"); Assert.assertEquals(StringFunctions.formatterForArray("Hello").apply(new Object[0]), "Hello"); }
@Test public static void testFormatterForArrayMulti() { Assert.assertEquals(StringFunctions.formatterForArray("1 %s 2 %s").apply(new Object[] {"val1", "val2"}), "1 val1 2 val2"); }
@Test public void testFormatter() { Assert.assertEquals(StringFunctions.formatter("hello %s").apply("world"), "hello world"); Assert.assertEquals(StringFunctions.formatterForArray("%s %s").apply(new String[] { "hello", "world" }), "hello world"); }