Utility method to parse a list of dates out of a list of elements.
<p>

@param elements the list of elements to parse.
@return the list of dates.
497435
protected final List<Date> parseElementListDate(final List<Element> elements, final Locale locale) {
        final List<Date> values = new ArrayList<Date>();
        for (final Element element : elements) {
            values.add(DateParser.parseDate(element.getText(), locale));
        }
        return values;
    }
1246347
public static List<VariableElement>
            fieldsIn(Iterable<? extends Element> elements) {
        return listFilter(elements, FIELD_KINDS, VariableElement.class);
    }
767643
@Pure
	public static Map<ShapeElementType, MapElementGroup> classifiesElements(Iterator<? extends MapElement> elements) {
		final Map<ShapeElementType, MapElementGroup> classification = new TreeMap<>();
		classifiesElements(classification, elements);
		return classification;
	}
41799
public static <E> LinkedList<E> newLinkedList(Iterable<? extends E> elements) {
		LinkedList<E> list = newLinkedList();
		for (E element : elements) {
			list.add(element);
		}
		return list;
	}
376557
static <T> List<T> list(T... elements) {
    return new ArrayList<>(Arrays.asList(elements));
  }
40972
@SafeVarargs
    public static <T> StreamEx<T> of(T... elements) {
        return of(Arrays.spliterator(elements));
    }
345633
public static Date parseDate(final String dateValue, final String[] dateFormats) {
        return parseDate(dateValue, dateFormats, null);
    }
1184917
public void setElements(List<AstNode> elements) {
        if (elements == null) {
            this.elements = null;
        } else {
            if (this.elements != null)
                this.elements.clear();
            for (AstNode e : elements)
                addElement(e);
        }
    }
668178
private SortedSet<Date> readDates(JSONArray array) {

        if (null != array) {
            SortedSet<Date> result = new TreeSet<>();
            for (int i = 0; i < array.length(); i++) {
                try {
                    long l = Long.valueOf(array.getString(i)).longValue();
                    result.add(new Date(l));
                } catch (NumberFormatException | JSONException e) {
                    LOG.error("Could not read date from JSON array.", e);
                }
            }
            return result;
        }
        return new TreeSet<>();
    }
795361
public static Set<Key<?>> getAllUnboundKeys(List<Element> elements) {
        final Set<Key<?>> boundKeys = new HashSet<>();
        for (Element element : elements) {
            element.acceptVisitor(new DefaultElementVisitor<Void>() {
                public <T> Void visit(Binding<T> binding) {
                    boundKeys.add(binding.getKey());
                    return null;
                }
            });
        }

        final Set<Key<?>> foundKeys = new HashSet<>();
        
        for (Element element : elements) {
            element.acceptVisitor(new DefaultElementVisitor<Void>() {
                @Override
                public <T> Void visit(Binding<T> binding) {
                    binding.acceptTargetVisitor(new DefaultBindingTargetVisitor<T, Void>() {
                        @Override
                        public Void visit(ProviderKeyBinding<? extends T> binding) {
                            addFoundKeys(getUnboundDirectDependencies(binding.getProviderKey().getTypeLiteral(), boundKeys));
                            return null;
                        }

                        @Override
                        public Void visit(LinkedKeyBinding<? extends T> binding) {
                            if (!boundKeys.contains(binding.getLinkedKey())) {
                                addFoundKeys(getUnboundDirectDependencies(binding.getLinkedKey().getTypeLiteral(), boundKeys));
                            }
                            return null;
                        }

                        @Override
                        public Void visit(UntargettedBinding<? extends T> binding) {
                            addFoundKeys(getUnboundDirectDependencies(binding.getKey().getTypeLiteral(), boundKeys));
                            return null;
                        }

                        @Override
                        public Void visit(ConstructorBinding<? extends T> binding) {
                            addFoundKeys(getUnboundDirectDependencies(binding.getInjectableMembers(), boundKeys));
                            addFoundKeys(getUnboundDirectDependencies(binding.getDependencies(), boundKeys));
                            return null;
                        }

                        @Override
                        public Void visit(ProviderBinding<? extends T> binding) {
                            addFoundKeys(getUnboundDirectDependencies(binding.getProvidedKey().getTypeLiteral(), boundKeys));
                            return null;
                        }
                        
                        private void addFoundKeys(Set<Key<?>> keys) {
                            foundKeys.addAll(keys);
                        }
                    });
                    return null;
                }

                /**
                 * Visit a request to inject the instance fields and methods of an instance.
                 */
                @Override
                public Void visit(InjectionRequest<?> request) {
                    for (InjectionPoint ip : request.getInjectionPoints()) {
                        for (Dependency<?> dep : ip.getDependencies()) {
                            foundKeys.addAll(getUnboundDirectDependencies(dep.getKey().getTypeLiteral(), boundKeys));
                        }
                    }
                    return null;
                }

                /**
                 * Visit a request to inject the static fields and methods of type.
                 */
                @Override
                public Void visit(StaticInjectionRequest request) {
                    for (InjectionPoint ip : request.getInjectionPoints()) {
                        for (Dependency<?> dep : ip.getDependencies()) {
                            foundKeys.addAll(getUnboundDirectDependencies(dep.getKey().getTypeLiteral(), boundKeys));
                        }
                    }
                    return null;
                }

                
                /**
                 * Visit a lookup of the provider for a type.
                 */
                @Override
                public <T> Void visit(ProviderLookup<T> lookup) {
                    foundKeys.add(lookup.getDependency().getKey());
                    return null;
                }
            });
        }
        
        // Recursively look at the final list of unbound keys to further discover dependencies
        // and exclude keys that may be instantiated using the JIT
        for (Key<?> key : foundKeys) {
            discoverDependencies(key, boundKeys);
        }
        foundKeys.removeAll(boundKeys);
        foundKeys.remove(Key.get(Injector.class));
        return foundKeys;
    }
159231
public List<CmsContainerElementBean> getElements() {

        if (m_elements == null) {
            m_elements = new ArrayList<CmsContainerElementBean>();
            for (CmsContainerBean container : m_containers.values()) {
                m_elements.addAll(container.getElements());
            }
        }
        return m_elements;
    }
479412
@SafeVarargs
  public static <E> List<E> of(E... elements) {
    Preconditions.checkNotNull(elements, "elements");
    return Collections.unmodifiableList(Arrays.asList(elements));
  }
950778
public <T > Iterable<T> parse(Iterable<String> inputs, Class<T> clazz) {
		List<T> parsedValues = new LinkedList<>();
		for (String input : inputs) {
			parsedValues.add(parse(input, clazz));
		}

		return parsedValues;
	}
42216
public static <E> ArrayList<E> newArrayList(Iterable<? extends E> elements) {
		return (elements instanceof Collection) ? new ArrayList<E>((Collection<? extends E>)elements)
				: newArrayList(elements.iterator());
	}
372903
public static DateFormat getDateFormat(final Element element) {
		if (XMLTags.FORMAT.equals(element.getName())) {
			return createDateFormat(element);
		}
		Element child = element.getChild(XMLTags.FORMAT);
		if (child != null) {
			return createDateFormat(child);
		}
		return getDateFormat(element.getParentElement());
	}
696297
public static <T> Level0ListOperator<List<T>,T> onListFor(final T... elements) {
        return new Level0ListOperator<List<T>,T>(ExecutionTarget.forOp(VarArgsUtil.asRequiredObjectList(elements), Normalisation.LIST));
    }
1143986
@SuppressWarnings("unchecked")
    public static List<Element> elements(Element element, String name) {

        return element.elements(name);
    }