Param { protected abstract T parse(String str) throws Exception; Param(String name, T defaultValue); String getName(); T parseParam(String str); T value(); @Override String toString();  }
@Test public void testShort() throws Exception { Param<Short> param = new ShortParam("S", (short) 1) { }; test(param, "S", "a short", (short) 1, (short) 2, "x", "" + ((int) Short.MAX_VALUE + 1)); param = new ShortParam("S", (short) 1, 8) { }; assertEquals(new Short((short) 01777), param.parse("01777")); }