@SuppressWarnings("rawtypes")
    private int getNumPolicies() {
        try {
            Field field = policyFactory.getClass().getDeclaredField("policyCache");
            field.setAccessible(true);
            return ((Map) field.get(policyFactory)).size();
        } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
@return the number of policies in the factory
gateway/engine/core/src/test/java/io/apiman/gateway/engine/impl/PolicyLoadTest.java