### Question:
PipelineScriptParser { static Pair<List<Object>, String> parseParams( IteratorWithPrevious<String> it) throws ParseException { List<Object> params = new ArrayList<Object>(); String xml = ""; while (it.hasNext()) { String current = it.next(); if (StringUtils.isBlank(current)) break; if (current.startsWith(" #")) continue; if (!current.startsWith(" ")) { it.previous(); break; } int split = current.indexOf(": "); if (split == -1) { throw new ParseException( "incorrect parameter line, should have a key, followed by a column, followed by a space, followed by a value: '" + current + "'", -1); } String key = current.substring(0, split).trim(); String valueStr = current.substring(split + 1).trim(); xml += "<" + key + ">" + escapeXml(valueStr) + "</" + key + ">"; Object value = null; if (key.endsWith("__java")) { Interpreter i = new Interpreter(); key = key.substring(0, key.length() - 6); try { i.eval("value = " + valueStr + ";"); value = i.get("value"); } catch (Exception e) { throw new ParseException( "cannot compile and run '__java' parameter with value '" + valueStr + "', error:" + e.toString(), -1); } } else { if (valueStr.endsWith("\\")) { value = valueStr.substring(0, valueStr.length() - 1) + " " + parseNextLines(it); } else { value = valueStr; } } LOG.info(" +-param. {}=>{}", key, value); params.add(key); params.add(value); } return new Pair<List<Object>, String>(params, xml); }  static Pipeline parse(File scriptFile); static Pipeline parse(File scriptFile, List<String> replacementVars); static Pipeline parse(List<String> scriptLines,
            String parentFilePath, List<String> replacementVars);  }### Answer:
@Test public void testWrongIndentation() throws Exception { Pair<List<Object>, String> params = PipelineScriptParser .parseParams(new IteratorWithPrevious<String>(newArrayList( " a: bla", "b: bli"))); assertEquals( "only one pair of params, the second is considered the next ae definition", 2, params.getKey().size()); }
@Test public void testNoCOLUMN() throws Exception { Pair<List<Object>, String> params = PipelineScriptParser .parseParams(new IteratorWithPrevious<String>(newArrayList( " a: bla", "bbbbbla"))); assertEquals( "only one pair of params, the second is considered the next ae definition", 2, params.getKey().size()); }
@Test public void testParseParams() throws Exception { Pair<List<Object>, String> params = PipelineScriptParser .parseParams(new IteratorWithPrevious<String>( newArrayList(" a: bla"))); assertEquals(2, params.getKey().size()); assertEquals("xml works", "<a>bla</a>", params.getValue()); }
@Test public void testMultiline() throws Exception { Pair<List<Object>, String> params = PipelineScriptParser .parseParams(new IteratorWithPrevious<String>(newArrayList( " a: bla\\", " bli "))); assertEquals(2, params.getKey().size()); assertEquals("bla bli", params.getKey().get(1)); params = PipelineScriptParser .parseParams(new IteratorWithPrevious<String>(newArrayList( " a: bla\\", " bli\\", "boo ").listIterator())); assertEquals(2, params.getKey().size()); assertEquals("bla bli boo", params.getKey().get(1)); }