@Test public void testToBufferedReader() throws Exception { StringBuffer sb = new StringBuffer(); for (int i = 0; i < 10; i++) { sb.append("testToBufferedReader").append("\n"); } StringReader reader = new StringReader(sb.toString()); Method method = IOTinyUtils.class.getDeclaredMethod("toBufferedReader", new Class[]{Reader.class}); method.setAccessible(true); Object bReader = method.invoke(IOTinyUtils.class, reader); assertTrue(bReader instanceof BufferedReader); }
static private BufferedReader toBufferedReader(Reader reader) { return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); }
IOTinyUtils { static private BufferedReader toBufferedReader(Reader reader) { return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); } }
IOTinyUtils { static private BufferedReader toBufferedReader(Reader reader) { return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); }  }
IOTinyUtils { static private BufferedReader toBufferedReader(Reader reader) { return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); }  static String toString(InputStream input, String encoding); static String toString(Reader reader); static long copy(Reader input, Writer output); static List<String> readLines(Reader input); static void copyFile(String source, String target); static void delete(File fileOrDir); static void cleanDirectory(File directory); static void writeStringToFile(File file, String data, String encoding); }
IOTinyUtils { static private BufferedReader toBufferedReader(Reader reader) { return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); }  static String toString(InputStream input, String encoding); static String toString(Reader reader); static long copy(Reader input, Writer output); static List<String> readLines(Reader input); static void copyFile(String source, String target); static void delete(File fileOrDir); static void cleanDirectory(File directory); static void writeStringToFile(File file, String data, String encoding);  }