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