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