class CachedSchemaValidatorLoader {

    public JsonSchemaValidator loadSchemaValidator(String jsonSchema) throws InvalidJsonSchemaException {

        try {
            return schemaValidatorCache.get(jsonSchema, () -> JsonSchemaValidator.forUserSchema(jsonSchema));
        } catch (ExecutionException e) {
            if (e.getCause() instanceof InvalidJsonSchemaException) {
                throw (InvalidJsonSchemaException) e.getCause();
            } else {
                throw new InvalidJsonSchemaException("Could not load schema validator", e);
            }
        }
    }

    public  CachedSchemaValidatorLoader(int maxEntriesInCache, int cacheTimeoutInSeconds);

}