@Bean @SuppressWarnings({ "rawtypes", "serial", "unchecked" }) public static CustomAutowireConfigurer customAutowireConfigurer() { CustomAutowireConfigurer cac = new CustomAutowireConfigurer(); cac.setCustomQualifierTypes(new HashSet() {{ add(ComponentScanParserTests.CustomAnnotation.class); }}); return cac; }