How to set up unit test for service with dependency?

I have a service interface: interface MyService { int getItem(); } and a implementation: @Service class MyServiceImpl : implements MyService { public MyServiceImpl(List<Loader> loaders) { } public int getItem() { Loader loader = getTheLoader(); return loader.getItem(); } } I want to unit test MyServiceImpl. There’s more to it then just forwarding the getItem() call to… Read More How to set up unit test for service with dependency?