### Question:
ByteTypeConverter extends BytePrimitiveTypeConverter { @Override public Object convert(String value) throws ConversionException { return (Byte)super.convert(value); }  @Override Object convert(String value);  }### Answer:
@Test public void validConversions() throws Exception { for (TypeConverter pc : pcs) { Object obj = pc.convert("0"); Assert.assertEquals(obj, TypeConverterUtil.convert("0", obj.getClass())); Assert.assertEquals(Byte.valueOf((byte)0), pc.convert("0")); Assert.assertEquals(Byte.valueOf((byte)-128), pc.convert("-128")); Assert.assertEquals(Byte.valueOf((byte)127), pc.convert("127")); Assert.assertEquals(Byte.valueOf((byte)0), pc.convert("0x0")); Assert.assertEquals(Byte.valueOf((byte)0), pc.convert("0X0")); Assert.assertEquals(Byte.valueOf((byte)127), pc.convert("0x7F")); Assert.assertEquals(Byte.valueOf((byte)0xFF), pc.convert("0xFF")); } }
@Test public void overflow() throws Exception { for (TypeConverter pc : pcs) { try { pc.convert("0x100"); } catch (ConversionOverflowException e) { } } }
@Test public void negativeInHexNotAllowed() throws Exception { for (TypeConverter pc : pcs) { try { pc.convert("-0x01"); } catch (ConversionException e) { } } }