Get a fresh copy of the object.  For use with variables.

@return A fresh nodelist.
350104
public XObject getFresh()
  {
    try
    {
    	if(hasCache())
      		return (XObject)cloneWithReset();
      	else
      		return this; // don't bother to clone... won't do any good!
    }
    catch (CloneNotSupportedException cnse)
    {
      throw new RuntimeException(cnse.getMessage());
    }
  }
802783
public JSONNavi<?> atNext() {
		if (failure)
			return this;
		if (!(current instanceof List))
			return failure("current node is not an Array", null);
		@SuppressWarnings("unchecked")
		List<Object> lst = ((List<Object>) current);
		return at(lst.size());
	}
1083171
public ArrayList<DatanodeDescriptor> getDecommissioningNodesList() {

    try {
      return getDecommissioningNodesList(getDatanodeListForReport(DatanodeReportType.LIVE));
    } catch (Exception e) {
      return new ArrayList<DatanodeDescriptor>();
    }
  }
384546
public static List<Element> toElementList(NodeList nodeList) {
		List<Element> elements = new ArrayList<Element>();
		for (int i = 0; i < nodeList.getLength(); i++) {
			Node node = nodeList.item(i);
			if (node instanceof Element) {
				elements.add((Element) node);
			}
		}
		return elements;
	}
84499
public Iterator childNodes() {
        return new Iterator() {
            private final Iterator iter = Node.this.children.iterator();
            private Object nextElementNodes = getNextElementNodes();

            public boolean hasNext() {
                return this.nextElementNodes != null;
            }

            public Object next() {
                try {
                    return this.nextElementNodes;
                } finally {
                    this.nextElementNodes = getNextElementNodes();
                }
            }

            public void remove() {
                throw new UnsupportedOperationException();
            }

            private Object getNextElementNodes() {
                while (iter.hasNext()) {
                    final Object node = iter.next();
                    if (node instanceof Node) {
                        return node;
                    }
                }
                return null;
            }
        };
    }
1328891
public Version<Attributes<T>> getOrCreateVersion()
   {
      List<Node> nodeList = childNode.get("version");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new VersionImpl<Attributes<T>>(this, "version", childNode, nodeList.get(0));
      }
      return createVersion();
   }
498671
public static <E> ImmutableList<E> copyOf(E[] elements) {
    switch (elements.length) {
      case 0:
        return ImmutableList.of();
      case 1:
        return new SingletonImmutableList<E>(elements[0]);
      default:
        return new RegularImmutableList<E>(checkElementsNotNull(elements.clone()));
    }
  }
818965
public Node getCurrentNode()
  {

    if (!m_cacheNodes)
      throw new RuntimeException(
        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");

    int saved = m_next;
    Node n = (m_next < m_firstFree) ? elementAt(m_next) : null;
    m_next = saved; // HACK: I think this is a bit of a hack.  -sb
    return n;
  }
1277553
@Override
  protected void copyFromNew() {
    advancedValueSumList = newAdvancedValueSumList;
    advancedValueSumOfLogsList = newAdvancedValueSumOfLogsList;
    advancedValueSumOfSquaresList = newAdvancedValueSumOfSquaresList;
    advancedValueMinList = newAdvancedValueMinList;
    advancedValueMaxList = newAdvancedValueMaxList;
    advancedValueNList = newAdvancedValueNList;
  }
487017
public List<T> getElements() {
		ArrayList<T> list = new ArrayList<>(nodes.size());
		for (Node<T> node : nodes)
			list.add(node.element);
		return list;
	}
	
	/** Return the number of elements. */
	public int size() { return nodes.size(); }
	
}
42458
function copy() {
  const nodes = [];
  const cnodes = [];
  const mapping = {};
  this.each((node) => {
    nodes.push(node);
    const cnode = new Node(node.id, node.data);
    cnodes.push(cnode);
    mapping[cnode.id] = cnode;
  });

  cnodes.forEach((cnode, i) => {
    const node = nodes[i];
    cnode.children = node.children.map((c) => mapping[c.id]);
  });

  if (this.id === undefined) {
    const root = new Node(undefined, undefined);
    root.children = this.children.map((c) => mapping[c.id]);
  } else {
    return mapping[this.id];
  }
}
1030303
public DTMIterator cloneWithReset() throws CloneNotSupportedException
  {
  	NodeSequence seq = (NodeSequence)super.clone();
    seq.m_next = 0;
    if (m_cache != null) {
        // In making this clone of an iterator we are making
        // another NodeSequence object it has a reference
        // to the same IteratorCache object as the original
        // so we need to remember that more than one
        // NodeSequence object shares the cache.
        m_cache.increaseUseCount();
    }
    
    return seq;
  }
223274
public org.tensorflow.framework.CollectionDef.NodeList getNodeList() {
    if (kindCase_ == 1) {
       return (org.tensorflow.framework.CollectionDef.NodeList) kind_;
    }
    return org.tensorflow.framework.CollectionDef.NodeList.getDefaultInstance();
  }
791669
@SuppressWarnings({"rawtypes", "unchecked"})
    public static List getCloneList(List sourceList) {
        if (null == sourceList) {
            return null;
        }
        List targetList = new ArrayList();
        for (int i = 0; i < sourceList.size(); i++) {
            Object target = null;
            Object source = sourceList.get(i);
            try {
                Constructor con = source.getClass().getConstructor();
                target = con.newInstance();
                PropertyUtils.copyProperties(target, source);
            } catch (Exception e) {
                logger.error("clone object exception object class:" + source.getClass(), e);
            }
            targetList.add(target);
        }
        return targetList;
    }
1016184
public List<T> getAll() {
		List<T> result = new ArrayList<T>();
		if (nodes != null)
			for(Node element : nodes) 
				result.add(getCachedOrNewRepresentation(element));
		return result;
	}
	
	public int size() {
		return nodes.size();
	}
	
	public T get(int index) {
		return getCachedOrNewRepresentation(nodes.get(index));
	}
		
	public Iterator<T> iterator() {
		return getAll().iterator();
	}
}
515036
public XMLElementList getChildren() {
		if (children != null) {
			return children;
		}
		
		NodeList list = dom.getChildNodes();
		children = new XMLElementList();
		
		for (int i=0;i<list.getLength();i++) {
			if (list.item(i) instanceof Element) {
				children.add(new XMLElement((Element) list.item(i)));
			}
		}
		
		return children;
	}
1035149
public Object shallowCopy() {
        Object copy = null;
        try {
            copy = super.clone();
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
        return copy;
    }