### Question:
ArgumentsParser { public static Arguments[] parse(final String line) { final ArgumentsParser parser = new ArgumentsParser(line); return parser.parseArgs(); } ArgumentsParser(final String input);  ArgumentsParser(final InputStream input); static Arguments[] parse(final String line); Arguments[] parseArgs(); void endCommand(); Seq flush();  }### Answer:
@Test public void simple() { assertEquals(asList("a", "b", "c", "1234", "word"), asList(parse("a b c 1234 word")[0].get())); assertEquals(asList("a", "b", "-c", "--1234", "word"), asList(parse("a b -c --1234 word")[0].get())); }
@Test public void piping() { { final Arguments[] args = parse("a|b"); assertEquals(2, args.length); assertEquals(singletonList("a"), asList(args[0].get())); assertEquals(singletonList("b"), asList(args[1].get())); } { final Arguments[] args = parse("test --option=value \"-quoted=ckdwc\\\\cekwcbw\" | grep \"==foo\""); assertEquals(2, args.length); assertEquals(asList("test", "--option=value", "-quoted=ckdwc\\cekwcbw"), asList(args[0].get())); assertEquals(asList("grep", "==foo"), asList(args[1].get())); } }