Get all the elements in the same orbit in the permutation (unsorted).

@param element any element in the orbit
@return the list of elements reachable in this permutation
505180
public List<Integer> getOrbit(int element) {
        List<Integer> orbit = new ArrayList<Integer>();
        orbit.add(element);
        int i = values[element];
        while (i != element && orbit.size() < values.length) {
            orbit.add(i);
            i = values[i];
        }
        return orbit;
    }
79774
public boolean remove(final T element) {
    for (int i = 0; i < this.size; i++)
      if (this.elements[i].equals(element)) {
        System.arraycopy(this.elements, i + 1, this.elements, i, this.size - (i + 1));
        this.size--;
        return true;
      }
    return false;
  }
223141
public static <T> ArrayList<T> newArrayList(Iterable<T> elements) {
		return Lists.newArrayList(elements);
	}
779769
static int indexOfImpl(List<?> list, @Nullable Object element) {
    ListIterator<?> listIterator = list.listIterator();
    while (listIterator.hasNext()) {
      if (Objects.equal(element, listIterator.next())) {
        return listIterator.previousIndex();
      }
    }
    return -1;
  }
751566
public int find(int element) {
        if (trees[element] != element)
            trees[element] = find(trees[element]);
        return trees[element];
    }
664069
public List<T> nextPermutationAsList()
    {
        List<T> permutation = new ArrayList<T>(elements.length);
        return nextPermutationAsList(permutation);
    }
1120324
public Object[] getChildren(Object element)
	{
		if (element instanceof IResource || element instanceof INode)
		{
			IWorkbenchAdapter adapter = getAdapter(element);
			if (adapter != null)
			{
				return adapter.getChildren(element);
			}
			return NO_CHILDREN;
		}
		return NO_CHILDREN;
	}
254917
public T set(int index, T element)
    {
        if (index == 0)
        {
            T previousElement = this.element1;
            this.element1 = element;
            return previousElement;
        }
        throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + this.size());
    }
181035
public static boolean contains(Iterator<?> iterator, Object element) {
        if (iterator != null) {
            while (iterator.hasNext()) {
                Object candidate = iterator.next();
                if (ObjectUtils.nullSafeEquals(candidate, element)) {
                    return true;
                }
            }
        }
        return false;
    }
698205
protected boolean addElem(final T element) {
    // validate element
    if (element == null) {
      throw new IllegalArgumentException("Null element is not supported.");
    }
    // find hashCode & index
    final int hashCode = element.hashCode();
    final int index = getIndex(hashCode);
    // return false if already present
    if (containsElem(index, element, hashCode)) {
      return false;
    }

    modification++;
    size++;

    // update bucket linked list
    LinkedElement<T> le = new LinkedElement<T>(element, hashCode);
    le.next = entries[index];
    entries[index] = le;
    return true;
  }
1353509
public Node<T> get(T element) {
		for (Node<T> node : nodes)
			if (node.element.equals(element))
				return node;
		return null;
	}
303122
public static <T> Iterator<T> singleElementIterator(final T element) {
    return new Iterator<T>() {
      private boolean mHasNext = true;

      @Override
      public boolean hasNext() {
        return mHasNext;
      }

      @Override
      public T next() {
        if (!hasNext()) {
          throw new NoSuchElementException();
        }
        mHasNext = false;
        return element;
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException("remove is not supported.");
      }
    };
  }
1342047
@SafeVarargs
  public static <T> List<T> immutableList(T... elements) {
    return Collections.unmodifiableList(asList(elements.clone()));
  }
140303
public boolean containsElement(Element element) {
        String deepName = getDeepName(element);
        return elementNameSortOrderMap.containsKey(deepName);
    }
564376
@SafeVarargs
  public static <E> Set<E> of(E... elements) {
    Set<E> result = new HashSet<>();
    Collections.addAll(result, elements);
    return Collections.unmodifiableSet(result);
  }
1202456
public T set(int index, T element)
    {
        switch (index)
        {
            case 0:
                T previousElement1 = this.element1;
                this.element1 = element;
                return previousElement1;
            case 1:
                T previousElement2 = this.element2;
                this.element2 = element;
                return previousElement2;
            default:
                throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + this.size());
        }
    }
805603
public List<CmsElementComparison> getElements() {

        if (m_elements == null) {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(m_elements);
    }