if (!klass.isInstance(o)) throw new AssemblyException( new IllegalArgumentException( "Cannot add object " + o + " to array where the elements are of class " + klass));
if (length == Array.getLength(array)) { Object tmp = Array.newInstance(klass, length * 2); System.arraycopy(array, 0, tmp, 0, length); array = tmp; }
    public void addParameterObject(Object o) throws AssemblyException    {        if (!klass.isInstance(o))            throw new AssemblyException(                new IllegalArgumentException(                    "Cannot add object "                        + o                        + " to array where the elements are of class "                        + klass));        list.add(o);    }