Now, it's elegant.

The class which has a main method still cannot @Autowired