PreProcessMatrix { public void prependUnderscoreToRowNames() throws Exception { ArrayList<String> newRowNames = new ArrayList<String>(); for (String s : this.rowNames) { newRowNames.add("_" + s); } this.rowNames = newRowNames; } PreProcessMatrix(File in); void prependUnderscoreToRowNames(); void prependUnderscoreToColNames(); void escapeRowNames(); void escapeColNames(); void trimTextElements(); File getResult();  }
@Test public void testPrependUnderscoreToRowNames() throws Exception { PreProcessMatrix pm = new PreProcessMatrix(this.testMatrix); pm.prependUnderscoreToRowNames(); File result = pm.getResult(); String actual = readFile(result); String expected = "\tcol1$\t456col2\tcol3\n"; expected += "_234row1\tval1\tval2\tval3\n"; expected += "_&row2\tval4\tval5\tval6\n"; expected += "_678row3#\tval7\tval8\tval9\n"; Assert.assertEquals(actual, expected); }