FileUtil { public static List<String> readFile(String filename) { return readFile(filename, true); } private  FileUtil(); static List<String> readFile(String filename); static List<String> readFile(String filename, boolean reportError); static long getLongFromFile(String filename); static long getUnsignedLongFromFile(String filename); static int getIntFromFile(String filename); static String getStringFromFile(String filename); static Map<String, String> getKeyValueMapFromFile(String filename, String separator); static Properties readPropertiesFromFilename(String propsFilename);  }
@Test public void testReadFile() { List<String> thisFile = null; thisFile = FileUtil.readFile(NO_FILE); assertEquals(0, thisFile.size()); thisFile = FileUtil.readFile(THISCLASS); int lineOne = 0; int lineTwo = 0; for (int i = 0; i < thisFile.size(); i++) { String line = thisFile.get(i); if (lineOne == 0 && line.contains("Comment ONE line")) { lineOne = i; continue; } if (lineTwo == 0 && line.contains("Comment TWO line")) { lineTwo = i; break; } } assertEquals(2, lineTwo - lineOne); }