@Test
public void testCacheSchemaToJsonConversion() {

    Cache<Schema, ObjectNode> cache = Whitebox.getInternalState(converter, "fromConnectSchemaCache");
    assertEquals(0, cache.size());
    // Repeated conversion of the same schema, even if the schema object is different should return the same Java
    // object
    converter.fromConnectData(TOPIC, SchemaBuilder.bool().build(), true);
    assertEquals(1, cache.size());
    converter.fromConnectData(TOPIC, SchemaBuilder.bool().build(), true);
    assertEquals(1, cache.size());
    // Validate that a similar, but different schema correctly returns a different schema.
    converter.fromConnectData(TOPIC, SchemaBuilder.bool().optional().build(), true);
    assertEquals(2, cache.size());
}