### Question:
GenericRowValueTypeEnforcer { private String enforceString(final Object value) { if (value instanceof String || value instanceof CharSequence) { return value.toString(); } else if (value == null) { return null; } else { throw new KsqlException("Invalid field type. Value must be String."); } } GenericRowValueTypeEnforcer(final Schema schema); Object enforceFieldType(final int index, final Object value);  }### Answer:
@Test public void testEnforceString() { SchemaBuilder schemaBuilder = SchemaBuilder.struct().field("string", SchemaBuilder.string()); GenericRowValueTypeEnforcer genericRowValueTypeEnforcer = new GenericRowValueTypeEnforcer(schemaBuilder); try { genericRowValueTypeEnforcer.enforceFieldType(0, 0.0); fail("Expecting exception: KsqlException"); } catch (KsqlException e) { assertEquals(GenericRowValueTypeEnforcer.class.getName(), e.getStackTrace()[0].getClassName()); } }