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