### Question:
DefaultConfig { public ApplicationContext getAppCtx(){ return appCtx; } DefaultConfig(); ApplicationContext getAppCtx(); @Bean BlockStoreIfc blockStore(); @Bean TransactionStore transactionStore();  }### Answer:
@Test public void testDefaultInject(){ AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(DefaultConfig.class,TestConfig.class); DefaultConfig config = context.getBean(DefaultConfig.class); TestConfig testConfig = context.getBean(TestConfig.class); ProtoRpc protoRpc = context.getBean(ProtoRpcImpl.class); ProtoRpc protoRpc1 = testConfig.protoRpc(); Assert.assertNotEquals(protoRpc,protoRpc1); Assert.assertNotNull(config); Assert.assertNotNull(config.getAppCtx()); }