### Question:
GenericRowValueTypeEnforcer { private Integer enforceInteger(final Object value) { if (value instanceof Integer) { return (Integer) value; } else if (value instanceof Long) { return ((Long) value).intValue(); } else if (value instanceof Float) { return ((Float) value).intValue(); } else if (value instanceof Short) { return ((Short) value).intValue(); } else if (value instanceof Byte) { return ((Byte) value).intValue(); } else if (value instanceof String || value instanceof CharSequence) { return Integer.parseInt(value.toString()); } else if (value == null) { return null; } else { throw new KsqlException("Invalid field type. Value must be Integer."); } } GenericRowValueTypeEnforcer(final Schema schema); Object enforceFieldType(final int index, final Object value);  }### Answer:
@Test public void testEnforceInteger() { SchemaBuilder schemaBuilder = SchemaBuilder.struct().field("int", SchemaBuilder.int32()); 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()); } }