Spring 4 and older support the ability to automatically collect all beans of a given type and inject them into a collection or array.
Here is an example:
@Component
public class Car implements Vehicle {
}
@Component
public class Bus implements Vehicle {
}
@Component
public class User {
@Autowired
List<Vehicle> vehicles; // contains both car and bus
}
Ref: Spring 4 Ordering Autowired Collections