Curses { public static String tputs(String cap, Object... params) { if (cap != null) { StringWriter sw = new StringWriter(); tputs(sw, cap, params); return sw.toString(); } return null; } private  Curses(); static String tputs(String cap, Object... params); static void tputs(Appendable out, String str, Object... params);  }
@Test public void testTputs() throws Exception { assertEquals("{\033[3;4r", Curses.tputs("\\173\\E[%i%p1%d;%p2%dr", 2, 3)); }