List<String> (String filePath) { String content; try { content = StringUtil.convertLineSeparators(FileUtil.loadFile(new File(filePath))); } catch (IOException e) { throw new RuntimeException(e); } Assert.assertNotNull(content); List<String> input = new ArrayList<>(); int separatorIndex; content = StringUtil.replace(content, "\r", ""); // for MACs // Adding input before ----- while ((separatorIndex = content.indexOf("-----")) >= 0) { input.add(content.substring(0, separatorIndex - 1)); content = content.substring(separatorIndex); while (StringUtil.startsWithChar(content, '-')) { content = content.substring(1); } if (StringUtil.startsWithChar(content, '\n')) { content = content.substring(1); } } input.add(content); Assert.assertTrue("No data found in source file", input.size() > 0); Assert.assertTrue("Test output points to null", input.size() > 1); return input; }