I\'m using the method ApplicationContext.getBean(String name, Class requiredType). The bean is of type util:set. My code looks like:
Set mySe
Not really but there is a runtime workaround that at least removes the need for an @SuppressWarnings. You can make your class abstract and let Spring instrument your code:
public abstract class Test {
Set getMyBean();
}
and then inject a lookup method in your XML config:
It's not really statically checked but it fails-fast at runtime and you keep the ugly casting out of your code.