Add a method to check the type of resource

Change-Id: If4b44688c0a93a43dfa9a4c2cb77c52599159751
diff --git a/cli/src/main/java/org/onosproject/cli/net/ResourcesCommand.java b/cli/src/main/java/org/onosproject/cli/net/ResourcesCommand.java
index d6e637f..3b8ca89 100644
--- a/cli/src/main/java/org/onosproject/cli/net/ResourcesCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/ResourcesCommand.java
@@ -24,6 +24,7 @@
 import java.util.Arrays;
 import java.util.Collections;
 
+import com.google.common.collect.Iterables;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
@@ -158,7 +159,7 @@
             if (r instanceof ContinuousResource) {
                 // non-aggregatable terminal node
                 nonAggregatable.add(r);
-            } else if (aggregatableTypes.contains(r.last().getClass())) {
+            } else if (Iterables.any(aggregatableTypes, r::isTypeOf)) {
                 // aggregatable & terminal node
                 String className = r.last().getClass().getSimpleName();
                 aggregatables.put(className, r);