MySqlUnsignedIntegerConverter { public static int convertUnsignedSmallint(int originalNumber) { if (originalNumber < 0) { return originalNumber + SMALLINT_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 shouldConvertSignedBinlogSmallintToUnsigned() { assertEquals(65535, MySqlUnsignedIntegerConverter.convertUnsignedSmallint(-1)); assertEquals(65535, MySqlUnsignedIntegerConverter.convertUnsignedSmallint(65535)); }