NodeType implements Serializable { public boolean isIteratorOrArray(Class c) { if (c.isArray() && BaseIterator.class.isAssignableFrom(c.getComponentType())) { return true; } if (BaseIterator.class.isAssignableFrom(c)) { return true; } return false; } NodeType(Class<? extends BaseIterator> nodeClass); Class<? extends BaseIterator> getIteratorClass(); Class<?>[] getInputs(); Class<?>[] getParameterTypes(int length); boolean isIteratorOrArray(Class c); String toString();  }
@Test public void testIsIteratorOrArray() { NodeType n = new NodeType(ExtentIterator.class); assertTrue(n.isIteratorOrArray(ExtentIterator.class)); assertTrue(n.isIteratorOrArray(BaseIterator.class)); assertFalse(n.isIteratorOrArray(Integer.class)); assertFalse(n.isIteratorOrArray(Date.class)); assertTrue(n.isIteratorOrArray(new ExtentIterator[0].getClass())); }