Object[][] (String[] illegalChars, Function<String, String> toString) { Object[][] data = new Object[illegalChars.length][]; for (int i = 0; i < illegalChars.length; i++) { data[i] = new Object[]{ toString.fun(illegalChars[i]), "bra" + illegalChars[i] + "nch" }; } return data; }