Returns the first-set of the given abstractElement. That is, all keywords
with distinct values and all rule calls to distinct terminals.
@since 2.6
197878
public static List<AbstractElement> getFirstSet(AbstractElement element) {
		return org.eclipse.xtext.xtext.generator.parser.antlr.AntlrGrammarGenUtil.getFirstSet(element);
	}
697530
@Override
	public AbstractMessage nextElement()
	{
		if (cursor.endOfQueueReached())
			throw new NoSuchElementException();
		
		try
		{
			checkNotClosed();
			AbstractMessage msg = fetchNext();
			if (msg != null)
			{
				nextMessage = null; // Consume fetched message
				AbstractMessage msgCopy = MessageTools.duplicate(msg);
				msgCopy.ensureDeserializationLevel(MessageSerializationLevel.FULL);
				return msgCopy;
			}
			
			throw new NoSuchElementException();
		}
		catch (NoSuchElementException e)
		{
			throw e;
		}
		catch (JMSException e)
		{
			throw new IllegalStateException(e.toString());
		}
	}
306525
protected Elements getFirst(Elements elems) {
        @SuppressWarnings("unchecked")
        IterableElements<Elements> iterableElems = elems.as(IterableElements.class);
        return Iterables.getFirst(iterableElems, null);
    }
1074280
public AbstractType<?> getAbstractType() {
        if (abstractType != null) {
            return abstractType;
        }

        try {

            if (validatorKind == Kind.NOT_A_COLLECTION) {
                abstractType = MAP_ABSTRACT_TYPE_CLASS_TO_ABSTRACT_TYPE.get(forName
                        (validatorClassName));

            } else {
                throw new DeepGenericException("Cannot determine collection kind for " + validatorKind);

            }

        } catch (ClassNotFoundException e) {
            throw new DeepGenericException(e);
        }

        return abstractType;
    }
411858
private List<XsdElement> getAllElementsRecursively(XsdAbstractElement element) {
        List<XsdElement> allGroupElements = new ArrayList<>();
        List<XsdAbstractElement> directElements = element.getXsdElements().collect(Collectors.toList());

        allGroupElements.addAll(
                directElements.stream()
                        .filter(elem1 -> elem1 instanceof XsdElement)
                        .map(elem1 -> (XsdElement) elem1)
                        .collect(Collectors.toList()));

        for (XsdAbstractElement elem : directElements) {
            if ((elem instanceof XsdMultipleElements || elem instanceof XsdGroup) && elem.getXsdElements() != null) {
                allGroupElements.addAll(getAllElementsRecursively(elem));
            }
        }

        return allGroupElements;
    }
242579
@SuppressWarnings({"unchecked"})
    public static <T> T[] arrayOf(T[] firstElements, T lastElement) {
        checkArgNotNull(firstElements, "firstElements");
        Class elementType = firstElements.getClass().getComponentType();
        T[] array = (T[]) Array.newInstance(elementType, firstElements.length + 1);
        System.arraycopy(firstElements, 0, array, 0, firstElements.length);
        array[firstElements.length] = lastElement;
        return array;
    }
785937
public T removeFirst() {
		if (isEmpty()) {
			return null;
		}
		T firstElement = elements[firstIndex];
		elements[firstIndex] = null;
		firstIndex = incrementIndex(firstIndex, 0);
		return firstElement;
	}
289308
@CheckForNull
    public static String getFirstIdent(@Nonnull final DetailAST pAst)
    {
        String result = null;
        DetailAST ast = pAst.findFirstToken(TokenTypes.IDENT);
        if (ast != null) {
            result = ast.getText();
        }
        return result;
    }
1351386
public ElemTemplateElement getLastChildElem()
  {

    ElemTemplateElement lastChild = null;

    for (ElemTemplateElement node = m_firstChild; node != null;
            node = node.m_nextSibling)
    {
      lastChild = node;
    }

    return lastChild;
  }
1189601
@Override
	public String getFirst(String headerName) {
		List<String> headerValues = headers.get(headerName);
		return headerValues != null ? headerValues.get(0) : null;
	}
568813
@Override
    public Set keySet() {
        if (keySet != null) {
            return keySet;
        }
        keySet = new AbstractSet() {
            @Override
            public Iterator iterator() {
                return new KeyIterator();
            }            @Override
            public int size() {
                return size;
            }



            @Override
            public boolean contains(final Object o) {
                return containsKey(o);
            }


            @Override
            public boolean remove(final Object o) {
                final Object r = ReferenceMap.this.remove(o);
                return r != null;
            }

            @Override
            public void clear() {
                ReferenceMap.this.clear();
            }

        };
        return keySet;
    }
628592
public static <E> E first(Iterable<E> iterable) {
        dbc.precondition(iterable != null, "cannot call first with a null iterable");
        return new FirstElement<E>().apply(iterable.iterator());
    }
447906
function distinctElements(a1,a2){
    var ret = a1.slice();
    a2.forEach(function(a2item){
      if(ret.indexOf(a2item)<0){
        ret.push(a2item);
      }
    });
    return ret;
  }
718920
public int getFirstAttribute(int nodeHandle) {
                nodeHandle &= NODEHANDLE_MASK;

                // %REVIEW% jjk: Just a quick observation: If you're going to
                // call readEntry repeatedly on the same node, it may be
                // more efficiently to do a readSlot to get the data locally,
                // reducing the addressing and call-and-return overhead.

                // Should we check if handle is element (do we want sanity checks?)
                if (ELEMENT_NODE != (nodes.readEntry(nodeHandle, 0) & 0xFFFF))
                        return NULL;
                // First Attribute (if any) should be at next position in table
                nodeHandle++;
                return(ATTRIBUTE_NODE == (nodes.readEntry(nodeHandle, 0) & 0xFFFF)) ?
                nodeHandle | m_docHandle : NULL;
        }
1147146
public void hasFirstElement(@NullableDecl Object element) {
    if (actualAsNavigableSet().isEmpty()) {
      failWithActual("expected to have first element", element);
      return;
    }

    if (!Objects.equal(actualAsNavigableSet().first(), element)) {
      if (actualAsNavigableSet().contains(element)) {
        failWithoutActual(
            simpleFact(
                lenientFormat(
                    "Not true that %s has first element <%s>. "
                        + "It does contain this element, but the first element is <%s>",
                    actualAsString(), element, actualAsNavigableSet().first())));
        return;
      }
      failWithoutActual(
          simpleFact(
              lenientFormat(
                  "Not true that %s has first element <%s>. "
                      + "It does not contain this element, and the first element is <%s>",
                  actualAsString(), element, actualAsNavigableSet().first())));
    }
  }
944516
public static Element selectFirst(String cssQuery, Element root) {
        Validate.notEmpty(cssQuery);
        return Collector.findFirst(QueryParser.parse(cssQuery), root);
    }
1005364
@Nonnull
  @Override
  public Seq<E> distinct() {
    final HashSet<E> elements = new HashSet<>();
    final SeqBuilder<E> builder = Seq.builder(size());
    forEach(element -> {
      if (!elements.contains(element)) {
        builder.add(element);
        elements.add(element);
      }
    });
    return builder.result();
  }