### Question:
CharSequenceValueConverter implements ValueConverter<CharSequence> { @Override public byte convertToByte(CharSequence value) { if (value instanceof AsciiString && value.length() == 1) { return ((AsciiString) value).byteAt(0); } return Byte.parseByte(value.toString()); }  @Override CharSequence convertObject(Object value); @Override CharSequence convertInt(int value); @Override CharSequence convertLong(long value); @Override CharSequence convertDouble(double value); @Override CharSequence convertChar(char value); @Override CharSequence convertBoolean(boolean value); @Override CharSequence convertFloat(float value); @Override boolean convertToBoolean(CharSequence value); @Override CharSequence convertByte(byte value); @Override byte convertToByte(CharSequence value); @Override char convertToChar(CharSequence value); @Override CharSequence convertShort(short value); @Override short convertToShort(CharSequence value); @Override int convertToInt(CharSequence value); @Override long convertToLong(CharSequence value); @Override CharSequence convertTimeMillis(long value); @Override long convertToTimeMillis(CharSequence value); @Override float convertToFloat(CharSequence value); @Override double convertToDouble(CharSequence value); static final CharSequenceValueConverter INSTANCE; }### Answer:
@Test public void testByteFromAsciiString() { assertEquals(127, converter.convertToByte(AsciiString.of("127"))); }
@Test(expected = NumberFormatException.class) public void testByteFromEmptyAsciiString() { converter.convertToByte(AsciiString.EMPTY_STRING); }