MySqlUnsignedIntegerConverter { public static short convertUnsignedTinyint(short originalNumber) { if (originalNumber < 0) { return (short) (originalNumber + TINYINT_CORRECTION); } else { return originalNumber; } } private  MySqlUnsignedIntegerConverter(); static short convertUnsignedTinyint(short originalNumber); static int convertUnsignedSmallint(int originalNumber); static int convertUnsignedMediumint(int originalNumber); static long convertUnsignedInteger(long originalNumber); static BigDecimal convertUnsignedBigint(BigDecimal originalNumber);  }
@Test public void shouldConvertSignedBinlogTinyintToUnsigned() { assertEquals((short) 255, MySqlUnsignedIntegerConverter.convertUnsignedTinyint((short) -1)); assertEquals((short) 255, MySqlUnsignedIntegerConverter.convertUnsignedTinyint((short) 255)); }