void (JDefinedClass aClass, JAnnotationUse toRemove) { try { Field field = JDefinedClass.class.getDeclaredField("annotations"); field.setAccessible(true); List<?> annotations = (List<?>)field.get(aClass); annotations.remove(toRemove); } catch (NoSuchFieldException e) { throw new GenerationException(e); } catch (IllegalAccessException e) { throw new GenerationException(e); } }