### Question:
SchemaUtil { public static Schema getTypeSchema(final String sqlType) { switch (sqlType) { case "VARCHAR": case "STRING": return Schema.STRING_SCHEMA; case "BOOLEAN": case "BOOL": return Schema.BOOLEAN_SCHEMA; case "INTEGER": case "INT": return Schema.INT32_SCHEMA; case "BIGINT": case "LONG": return Schema.INT64_SCHEMA; case "DOUBLE": return Schema.FLOAT64_SCHEMA; default: return getKsqlComplexType(sqlType); } }  static Class getJavaType(final Schema schema); static Optional<Field> getFieldByName(final Schema schema, final String fieldName); static Schema getTypeSchema(final String sqlType); static int getFieldIndexByName(final Schema schema, final String fieldName); static Schema buildSchemaWithAlias(final Schema schema, final String alias); static String getSchemaFieldName(Field field); static String getJavaCastString(Schema schema); static Schema addImplicitRowTimeRowKeyToSchema(Schema schema); static Schema removeImplicitRowTimeRowKeyFromSchema(Schema schema); static Set<Integer> getRowTimeRowKeyIndexes(Schema schema); static String getSchemaDefinitionString(Schema schema); static String getSqlTypeName(Schema schema); static String buildAvroSchema(final Schema schema, String name); static Schema getAvroSerdeKsqlSchema(Schema schema); static String getFieldNameWithNoAlias(Field field); static Schema getSchemaWithNoAlias(Schema schema); static int getIndexInSchema(final String fieldName, final Schema schema); static final String ARRAY; static final String MAP; static final String ROWKEY_NAME; static final String ROWTIME_NAME; static final int ROWKEY_NAME_INDEX; }### Answer:
@Test public void shouldGetTheCorrectSchemaForBoolean() { Schema schema = SchemaUtil.getTypeSchema("BOOLEAN"); assertThat(schema, sameInstance(Schema.BOOLEAN_SCHEMA)); }
@Test public void shouldGetTheCorrectSchemaForInt() { Schema schema = SchemaUtil.getTypeSchema("INT"); assertThat(schema, sameInstance(Schema.INT32_SCHEMA)); }
@Test public void shouldGetTheCorrectSchemaForLong() { Schema schema = SchemaUtil.getTypeSchema("BIGINT"); assertThat(schema, sameInstance(Schema.INT64_SCHEMA)); }
@Test public void shouldGetTheCorrectSchemaForDouble() { Schema schema = SchemaUtil.getTypeSchema("DOUBLE"); assertThat(schema, sameInstance(Schema.FLOAT64_SCHEMA)); }
@Test public void shouldGetTheCorrectSchemaForString() { Schema schema = SchemaUtil.getTypeSchema("VARCHAR"); assertThat(schema, sameInstance(Schema.STRING_SCHEMA)); }
@Test public void shouldGetTheCorrectSchemaForArray() { Schema schema = SchemaUtil.getTypeSchema("ARRAY<DOUBLE>"); assertThat(schema.type(), sameInstance(Schema.Type.ARRAY)); }
@Test public void shouldGetTheCorrectSchemaForMap() { Schema schema = SchemaUtil.getTypeSchema("MAP<VARCHAR, DOUBLE>"); assertThat(schema.type(), sameInstance(Schema.Type.MAP)); }
@Test public void shouldFailForIncorrectSchema() { try { Schema schema8 = SchemaUtil.getTypeSchema("BYTES"); Assert.fail(); } catch (Exception e) { assertThat(e.getMessage(), equalTo("Unsupported type: BYTES")); } }