class AnnotationProxyPool {

    /**
     * generic key raw annotation
     * generic value proxy annotation
     */
    private static final Map<Annotation, Annotation> annotationPool = new HashMap<>();

    public static <A extends Annotation> A getOrPut(A rawAnnotation, Function<A, A> function) {<FILL_FUNCTION_BODY>}

}

        if (annotationPool.containsKey(rawAnnotation)) return (A) annotationPool.get(rawAnnotation);
        A proxyAnnotation = function.apply(rawAnnotation);
        annotationPool.put(rawAnnotation, proxyAnnotation);
        return proxyAnnotation;
    
<no_super_class>