if (types[i].equals(output.getClass()))
if (types[i].isInstance(output))
  public void setOutput(Object output)  {    if (output != null)      {	// Check if its a valid output object.	boolean found = false;	Class[] types = null;	if (originatingProvider != null)	  types = originatingProvider.getOutputTypes();		if (types != null)	  for (int i = types.length - 1; i >= 0; --i)	    if (types[i].equals(output.getClass()))	      found = true;	if (! found)	  throw new IllegalArgumentException("output type not available");      }    this.output = output;  }