public void testList() throws ParseException {
String str = "{0,list:max=3,number:curcode=1:space,currency}";
List<TemplateChunk> parsed = MessageStyle.MESSAGE_FORMAT.parse(str);
assertEquals(1, parsed.size());
ArgumentChunk chunk = (ArgumentChunk) parsed.get(0);
assertTrue(chunk.isList());
assertEquals("number", chunk.getFormat());
assertEquals("currency", chunk.getSubFormat());
Map<String, String> args = chunk.getListArgs();
assertEquals(1, args.size());
assertEquals("3", args.get("max"));
args = chunk.getFormatArgs();
assertEquals(2, args.size());
assertEquals("1", args.get("curcode"));
assertEquals("", args.get("space"));
str = "{0,list,number}";
parsed = MessageStyle.MESSAGE_FORMAT.parse(str);
assertEquals(1, parsed.size());
chunk = (ArgumentChunk) parsed.get(0);
assertTrue(chunk.isList());
assertEquals("number", chunk.getFormat());
assertNull(chunk.getSubFormat());
args = chunk.getListArgs();
assertEquals(0, args.size());
args = chunk.getFormatArgs();
assertEquals(0, args.size());
}