java dependency injection through code