@Test void getBlog() { Blog blogInstance1 = applicationContext.getBean("blog2", Blog.class); Blog blogInstance2 = applicationContext.getBean("blog2", Blog.class); assertThat(blogInstance1).isNotEqualTo(blogInstance2); }
@Bean(name = "blog2") @Scope("prototype") public Blog getBlog() { return new Blog(); }
PrototypeDemo { @Bean(name = "blog2") @Scope("prototype") public Blog getBlog() { return new Blog(); } }
PrototypeDemo { @Bean(name = "blog2") @Scope("prototype") public Blog getBlog() { return new Blog(); }  }
PrototypeDemo { @Bean(name = "blog2") @Scope("prototype") public Blog getBlog() { return new Blog(); }  @Bean(name = "blog2") @Scope("prototype") Blog getBlog(); }
PrototypeDemo { @Bean(name = "blog2") @Scope("prototype") public Blog getBlog() { return new Blog(); }  @Bean(name = "blog2") @Scope("prototype") Blog getBlog();  }