Spring - adding a bean in code Nov 22, 2016 loginacrocontext, email, display_nameacrocontext, first_name, last_name 1 2 3 AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); Set<int> sets = new Set<int>(); ctx.getBeanFactory().registerSingleton("test", set);