try {
Object result = method.invoke(extension);
if (result != null) {
if (result instanceof Class) {
results.addAll(componentContainer.getComponentsByType((Class) result));
<BUG>} else if (result instanceof Collection) {

results.addAll((Collection) result);
</BUG>
} else {

try {
Object result = method.invoke(extension);
if (result != null) {
if (result instanceof Class) {
results.addAll(componentContainer.getComponentsByType((Class) result));
} else if (result instanceof Collection<?>) {
results.addAll((Collection<?>) result);
} else {
