### Question:
SchemaHelper { public static SchemaBuilder buildSchemaBuilderForType(final Object value) { Objects.requireNonNull(value); final Schema knownSchema = Values.inferSchema(value); if (knownSchema == null) { if (value instanceof Date) { return org.apache.kafka.connect.data.Date.builder(); } if (value instanceof BigDecimal) { return Decimal.builder(((BigDecimal) value).scale()); } if (value instanceof Map) { return new SchemaBuilder(Schema.Type.MAP); } if (value instanceof List) { return new SchemaBuilder(Schema.Type.ARRAY); } return SchemaBuilder.bytes().optional(); } return SchemaUtil.copySchemaBasics(knownSchema); } private  SchemaHelper(); static SchemaBuilder buildSchemaBuilderForType(final Object value);  }### Answer:
@Test public void testBuildSchemaBuilderForAllKnownTypes() { assertEquals(SchemaBuilder.STRING_SCHEMA, SchemaHelper.buildSchemaBuilderForType("test").build()); assertEquals(SchemaBuilder.BOOLEAN_SCHEMA, SchemaHelper.buildSchemaBuilderForType(false).build()); assertEquals(SchemaBuilder.INT8_SCHEMA, SchemaHelper.buildSchemaBuilderForType(new Byte("1")).build()); assertEquals(SchemaBuilder.INT16_SCHEMA, SchemaHelper.buildSchemaBuilderForType(new Short("1")).build()); assertEquals(SchemaBuilder.INT32_SCHEMA, SchemaHelper.buildSchemaBuilderForType(1).build()); assertEquals(SchemaBuilder.INT64_SCHEMA, SchemaHelper.buildSchemaBuilderForType(1L).build()); assertEquals(SchemaBuilder.FLOAT32_SCHEMA, SchemaHelper.buildSchemaBuilderForType(new Float("1")).build()); assertEquals(SchemaBuilder.FLOAT64_SCHEMA, SchemaHelper.buildSchemaBuilderForType(new Double("1")).build()); assertEquals(SchemaBuilder.BYTES_SCHEMA, SchemaHelper.buildSchemaBuilderForType("test".getBytes()).build()); }
@Test public void testBuildSchemaBuilderForAllSpecialTypes() { final Map<String, Object> inputMap = new LinkedHashMap<>(); inputMap.put("test", "value being tested"); assertEquals(Schema.Type.MAP, SchemaHelper.buildSchemaBuilderForType(inputMap).type()); final List<String> inputList = Arrays.asList("test1", "test2"); assertEquals(Schema.Type.ARRAY, SchemaHelper.buildSchemaBuilderForType(inputList).type()); final Date date = new Date(); assertEquals(org.apache.kafka.connect.data.Date.SCHEMA, SchemaHelper.buildSchemaBuilderForType(date).build()); final BigDecimal bigDecimal = new BigDecimal("1"); assertEquals(Decimal.schema(bigDecimal.scale()), SchemaHelper.buildSchemaBuilderForType(bigDecimal).build()); final Schema schema = SchemaBuilder.struct() .field("id", Schema.INT32_SCHEMA) .build(); final Struct structValue = new Struct(schema); structValue.put("id", 1); assertEquals(Schema.Type.STRUCT, SchemaHelper.buildSchemaBuilderForType(structValue).type()); final CustomType customType = new CustomType(); assertEquals(Schema.Type.BYTES, SchemaHelper.buildSchemaBuilderForType(customType).type()); }