### Question:
MysqlNativeTypeUtils { public static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType) { if (MysqlType.BIT.equals(mysqlNativeType.getMysqlType())) return true; return mysqlNativeType.isUnsignedAttribute() && isUnsigned(columnMetadata); } private  MysqlNativeTypeUtils(); static boolean isUnsigned(ColumnMetadata columnMetadata, MysqlNativeType mysqlNativeType); static boolean isUnsigned(ColumnMetadata columnMetadata);  }### Answer:
@Test public void testIsUnsignedColumnMetadataMysqlNativeType() { try { assertTrue("Bit native type should return true", MysqlNativeTypeUtils.isUnsigned(null, new MysqlNativeType(MysqlType.BIT))); assertFalse("Signed varchar should return false", MysqlNativeTypeUtils.isUnsigned(null, new MysqlNativeType(MysqlType.VARCHAR))); assertFalse("Signed date should return false", MysqlNativeTypeUtils.isUnsigned(null, new MysqlNativeType(MysqlType.DATE))); MysqlType[] mysqlTypes = { MysqlType.TINYINT, MysqlType.SMALLINT, MysqlType.INT, MysqlType.BIGINT, MysqlType.FLOAT, MysqlType.DOUBLE, MysqlType.DECIMAL, }; for (MysqlType mysqlType : mysqlTypes) { ColumnMetadata cm = new ColumnMetadata(); assertFalse(mysqlType.toString() + " should return false", MysqlNativeTypeUtils.isUnsigned(cm, new MysqlNativeType(MysqlType.INT))); cm.setUnsigned(true); assertTrue(mysqlType.toString() + " should return true", MysqlNativeTypeUtils.isUnsigned(cm, new MysqlNativeType(MysqlType.INT))); } } catch (Exception e) { failWithStackTrace(e); } }
@Test public void testIsUnsignedColumnMetadata() { assertFalse("Null cm should return false", MysqlNativeTypeUtils.isUnsigned(null)); ColumnMetadata cm = new ColumnMetadata(); assertFalse("Empty cm should return false", MysqlNativeTypeUtils.isUnsigned(cm)); cm.setUnsigned(true); assertTrue("Unsigned modifier should return true", MysqlNativeTypeUtils.isUnsigned(cm)); }