### Question:
ArgumentsParser { public void parse(String[] args) { for (String arg : args) { int pos = arg.indexOf("="); if (pos < 0) { throw new IllegalArgumentException(arg); } String key = arg.substring(0, pos); String value = arg.substring(pos + 1, arg.length()); if (!beanDesc.hasPropertyDesc(key)) { continue; } PropertyDesc propertyDesc = beanDesc.getPropertyDesc(key); if (!propertyDesc.hasWriteMethod()) { continue; } ArgumentType<?> argumentType = ArgumentTypeRegistry .getArgumentType(propertyDesc); if (argumentType == null) { logger.log("WS2JDBCGEN0001", new Object[] { bean.getClass().getName(), propertyDesc.getPropertyName() }); continue; } Object propertyValue = argumentType.toObject(value); propertyDesc.setValue(bean, propertyValue); } } ArgumentsParser(Object bean); void parse(String[] args);  }### Answer:
@Test public void testParse() { MyBean bean = new MyBean(); ArgumentsParser parser = new ArgumentsParser(bean); parser .parse(new String[] { "string='aaa'", "integer=1", "bool=true", "ch=\\u0097", "myEnum=AAA", "list=['aaa','bbb']", "file='aaa'" }); assertEquals("aaa", bean.getString()); assertEquals(new Integer(1), bean.getInteger()); assertTrue(bean.isBool()); assertEquals('a', bean.getCh()); assertEquals(MyEnum.AAA, bean.getMyEnum()); assertEquals(Arrays.asList("aaa", "bbb"), bean.getList()); assertEquals(new File("aaa"), bean.getFile()); }
@Test public void testParse_nullOrDefaultValue() { MyBean bean = new MyBean(); ArgumentsParser parser = new ArgumentsParser(bean); parser.parse(new String[] { "string=", "integer=", "bool=", "ch=\\u0000", "myEnum=", "list=", "file=" }); assertNull(bean.getString()); assertNull(bean.getInteger()); assertFalse(bean.isBool()); assertEquals('\u0000', bean.getCh()); assertNull(bean.getMyEnum()); assertNull(bean.getList()); assertNull(bean.getFile()); }