### Question:
HbaseSchemaUtils { public static Object coerceType(boolean isNative, ArrowType type, byte[] value) { if (value == null) { return null; } Types.MinorType minorType = Types.getMinorTypeForArrowType(type); switch (minorType) { case VARCHAR: return Bytes.toString(value); case INT: return isNative ? ByteBuffer.wrap(value).getInt() : Integer.parseInt(Bytes.toString(value)); case BIGINT: return isNative ? ByteBuffer.wrap(value).getLong() : Long.parseLong(Bytes.toString(value)); case FLOAT4: return isNative ? ByteBuffer.wrap(value).getFloat() : Float.parseFloat(Bytes.toString(value)); case FLOAT8: return isNative ? ByteBuffer.wrap(value).getDouble() : Double.parseDouble(Bytes.toString(value)); case BIT: if (isNative) { return (value[0] != 0); } else { return Boolean.parseBoolean(Bytes.toString(value)); } case VARBINARY: return value; default: throw new IllegalArgumentException(type + " with minorType[" + minorType + "] is not supported."); } } private  HbaseSchemaUtils(); static Schema inferSchema(HBaseConnection client, TableName tableName, int numToScan); static String getQualifiedTableName(TableName tableName); static org.apache.hadoop.hbase.TableName getQualifiedTable(TableName tableName); static Types.MinorType inferType(byte[] value); static Object coerceType(boolean isNative, ArrowType type, byte[] value); static String[] extractColumnParts(String glueColumnName); static byte[] toBytes(boolean isNative, Object value);  }### Answer:
@Test public void coerceTypeTest() { boolean isNative = false; assertEquals("asf", coerceType(isNative, Types.MinorType.VARCHAR.getType(), "asf".getBytes())); assertEquals("2.0", coerceType(isNative, Types.MinorType.VARCHAR.getType(), "2.0".getBytes())); assertEquals(1, coerceType(isNative, Types.MinorType.INT.getType(), "1".getBytes())); assertEquals(-1, coerceType(isNative, Types.MinorType.INT.getType(), "-1".getBytes())); assertEquals(1L, coerceType(isNative, Types.MinorType.BIGINT.getType(), "1".getBytes())); assertEquals(-1L, coerceType(isNative, Types.MinorType.BIGINT.getType(), "-1".getBytes())); assertEquals(1.1F, coerceType(isNative, Types.MinorType.FLOAT4.getType(), "1.1".getBytes())); assertEquals(-1.1F, coerceType(isNative, Types.MinorType.FLOAT4.getType(), "-1.1".getBytes())); assertEquals(1.1D, coerceType(isNative, Types.MinorType.FLOAT8.getType(), "1.1".getBytes())); assertEquals(-1.1D, coerceType(isNative, Types.MinorType.FLOAT8.getType(), "-1.1".getBytes())); assertArrayEquals("-1.1".getBytes(), (byte[]) coerceType(isNative, Types.MinorType.VARBINARY.getType(), "-1.1".getBytes())); }