MySqlUnsignedIntegerConverter { public static long convertUnsignedInteger(long originalNumber) { if (originalNumber < 0) { return originalNumber + INT_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 shouldConvertSignedBinlogIntToUnsigned() { assertEquals(4294967295L, MySqlUnsignedIntegerConverter.convertUnsignedInteger(-1L)); assertEquals(4294967295L, MySqlUnsignedIntegerConverter.convertUnsignedInteger(4294967295L)); }