It casts an array of objets to an array of GraphRole

@param o the array of objects
@return
767473
public static GraphRole[] toGRoArray(Object[] o) {
        GraphRole[] result = new GraphRole[o.length];
        System.arraycopy(o, 0, result, 0, o.length);
        return result;
    }
1082801
@SuppressWarnings({"SuspiciousToArrayCall"})
  public <T> T[] toArray(T[] o) {
    Iterator<E> iter = iterator();
    ArrayList<E> al = new ArrayList<E>();
    while (iter.hasNext()) {
      al.add(iter.next());
    }
    return al.toArray(o);
  }
483098
public Criteria gt(Object o) {
        this.criteriaType = RelationalOperator.GT;
        this.right = ValueNode.toValueNode(o);
        return this;
    }
7383
public boolean add(Object o) {
		try {
			this.addElement((Element) o);
			return true;
		}
		catch(ClassCastException cce) {
			throw new ClassCastException("You can only add objects that implement the Element interface.");
		}
		catch(BadElementException bee) {
			throw new ClassCastException(bee.getMessage());
		}
	}
563238
public GraphObject getGraphObject(Object obj)
	{
		String key = getKey(obj);
		GraphObject go = objectMap.get(key);

//		if (obj instanceof Conversion && go == null)
//		{
//			go = objectMap.get(key + ConversionWrapper.LEFT_TO_RIGHT);
//			if (go == null)
//				go = objectMap.get(key + ConversionWrapper.RIGHT_TO_LEFT);
//		}

		if (go == null)
		{
			Node node = wrap(obj);

			if (node != null)
			{
				objectMap.put(key, node);
				node.init();
			}
		}

		return objectMap.get(key);
	}
902554
public static Iterable<GraphObject> map(final Iterable<Object> src) {

		return Iterables.map((Object t) -> {

			if (t instanceof GraphObject) {
				return (GraphObject)t;
			} else if (t instanceof Map) {
				return Function.toGraphObjectMap((Map)t);
			} else {

				return (GraphObject)UiFunction.toGraphObject(t, 1);
			}

		}, src);

	}
1099976
public QueryNode[] getOperands() {
        if (operands == null) {
            return new QueryNode[0];
        } else {
            return (QueryNode[]) operands.toArray(new QueryNode[operands.size()]);
        }
    }
27271
public static <T> T castIfInstance(Object o, Class<T> c) {
        return o != null && c.isInstance(o) ? c.cast(o) : null;
    }
107393
public static boolean isObjectAnObject(java.lang.Object o) {
    return o instanceof JavaScriptObject && isValueObject(wrap0(o));
  }
791560
public Object[] getAsModel(Map<Class<?>, List<Object>> o, Class<? extends D6Model> modelClazz) {

    return toArray(o.get(modelClazz), modelClazz);
  }
410137
@Deprecated
    public static Node toNode(Object o) throws PageException {
	if (o instanceof XMLStruct) return ((XMLStruct) o).toNode();
	if (o instanceof Node) return (Node) o;
	throw new CasterException(o, "node");
    }
419471
public boolean add(Object o) {

        resetCapacity();

        if (endindex == list.length) {
            endindex = 0;
        }

        list[endindex] = o;

        elementCount++;
        endindex++;

        return true;
    }
482684
private static <T> T cast(Class<T> clazz, Object o) {
        if (! clazz.isInstance(o))
            throw new IllegalArgumentException(o.toString());
        return clazz.cast(o);
    }
476219
public Set<GraphObject> run()
	{
		for (GraphObject go : new HashSet<GraphObject>(result))
		{
			if (go instanceof Node)
			{
				checkNodeRecursive((Node) go);
			}
		}
		return result;
	}
116723
public String getObjectsAsString(final Graph graph,
            final Node subject, final Resource predicate, final boolean uriAsLink) {
        LOGGER.trace("Getting Objects as String: s:{}, p:{}, g:{}", subject, predicate, graph);
        final Iterator<Node> iterator = listObjects(graph, subject, predicate.asNode());
        if (iterator.hasNext()) {
            final Node obj = iterator.next();
            if (obj.isLiteral()) {
                final String lit = obj.getLiteralValue().toString();
                return lit.isEmpty() ? "<empty>" : lit;
            }
            return uriAsLink ? "&lt;<a href=\"" + obj.getURI() + "\">" + obj.getURI() + "</a>&gt;" : obj.getURI();
        }
        return "";
    }
720528
public static Iterator<Object> getMultiValueIterator(final Object iObject) {
    if (iObject == null)
      return null;

    if (!isMultiValue(iObject))
      return null;

    if (iObject instanceof Collection<?>)
      return ((Collection<Object>) iObject).iterator();
    if (iObject instanceof Map<?, ?>)
      return ((Map<?, Object>) iObject).values().iterator();
    if (iObject.getClass().isArray())
      return new OIterableObjectArray<Object>(iObject).iterator();
    return null;
  }
1028715
function(obj) { 
   if(!this.nodes[obj.id]) {  
     var edges = this.edges[obj.id] = {};
     this.nodes[obj.id] = new Graph.Node($.extend({
        'id': obj.id,
        'name': obj.name,
        'data': obj.data || {},
        'adjacencies': edges 
      }, this.opt.Node), 
      this.opt.complex, 
      this.Node, 
      this.Edge,
      this.Label);
    }
    return this.nodes[obj.id];
  }