Relaxed implementation of the java 9 Map.ofEntries.
LinkedHashMap ensures element order remains as supplied.
@param entries array of Map.Entry elements
@return a mutable, type relaxed LinkedHashMap
17245
private static Map<?, ?> mapOfEntries( Entry<?, ?>... entries ) {
        Map<Object, Object> looseTypedMap = new LinkedHashMap<>( entries.length );
        for (Entry<?, ?> entry : entries)
            looseTypedMap.put(entry.getKey(), entry.getValue());
        return looseTypedMap;
    }
408531
@SafeVarargs
    private static Map<Pattern, Pass> asMap(
        final Map.Entry<Pattern, Pass>... entries) {
        final Map<Pattern, Pass> map = new HashMap<>(entries.length);
        for (final Map.Entry<Pattern, Pass> ent : entries) {
            map.put(ent.getKey(), ent.getValue());
        }
        return map;
    }
57638
public static <K, V> Ordering<Entry<K, V>> byKeyOrdering(Ordering<K> keyOrdering) {
    return keyOrdering.onResultOf(MapUtils.<K, V>getEntryKey());
  }
911157
public static <K extends Comparable<? super K>, V> List<Map.Entry<K, V>> sortedEntries(Collection<Map.Entry<K, V>> entries) {
    List<Entry<K,V>> entriesList = new ArrayList<Map.Entry<K, V>>(entries);
    Collections.sort(entriesList, new Comparator<Map.Entry<K, V>>() {
      public int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {
        return e1.getKey().compareTo(e2.getKey());
      }
    });
    return entriesList;
  }
1315414
public synchronized ArrayList<LinkedHashMap.Entry<K, V>> getMatchingEntries(
      @Nullable Predicate<K> predicate) {
    ArrayList<LinkedHashMap.Entry<K, V>> matchingEntries = new ArrayList<>(mMap.entrySet().size());
    for (LinkedHashMap.Entry<K, V> entry : mMap.entrySet()) {
      if (predicate == null || predicate.apply(entry.getKey())) {
        matchingEntries.add(entry);
      }
    }
    return matchingEntries;
  }
924006
public final void setEntries(@NonNull final CharSequence[] entries) {
        Condition.INSTANCE.ensureNotNull(entries, "The entries may not be null");
        this.entries = entries;
    }
622615
public static <E> LinkedHashSet<E> newLinkedHashSet(Iterable<? extends E> elements) {
		if (elements instanceof Collection) {
			return new LinkedHashSet<E>((Collection<? extends E>)elements);
		}
		LinkedHashSet<E> set = newLinkedHashSet();
		for (E element : elements) {
			set.add(element);
		}
		return set;
	}
810325
public KeePassFileBuilder addTopEntries(Entry... entries) {
        for (Entry entry : entries) {
            topGroupBuilder.addEntry(entry);
        }

        return this;
    }
452768
public Iterable<Map.Entry<Integer, Record>> entries() {
        return () -> new Iterator<Map.Entry<Integer, Record>>() {
            private final Iterator<Map.Entry<Integer, Record>> it = data.records.entrySet().iterator();

            /** {@inheritDoc} */
            @Override
            public boolean hasNext() {
                return it.hasNext();
            }

            /** {@inheritDoc} */
            @Override
            public Map.Entry<Integer, Record> next() {
                return it.next();
            }

            /** {@inheritDoc} */
            @Override
            public void remove() {
                throw new UnsupportedOperationException("This is a read-only iterator, remove operation is not supported.");
            }
        };
    }
1273779
public static <K, V> List<Entry<K, V>> sortEntryToList(Collection<Entry<K, V>> collection) {
		List<Entry<K, V>> list = new LinkedList<>(collection);
		Collections.sort(list, new Comparator<Entry<K, V>>() {

			@SuppressWarnings({ "rawtypes", "unchecked" })
			@Override
			public int compare(Entry<K, V> o1, Entry<K, V> o2) {
				V v1 = o1.getValue();
				V v2 = o2.getValue();

				if (v1 instanceof Comparable) {
					return ((Comparable) v1).compareTo(v2);
				} else {
					return v1.toString().compareTo(v2.toString());
				}
			}
		});
		return list;
	}
963265
public Iterator<Entry<String, Object>> entryIterator() {
        final Iterator<String> iter = keyIterator();
        return new Iterator<Entry<String, Object>>() {
            @Override
            public boolean hasNext() {
                return iter.hasNext();
            }

            @Override
            public Entry<String, Object> next() {
                String key = iter.next();
                Object value = get(key);
                return new MyMapEntry(BeanMap.this, key, value);
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException("remove() not supported for BeanMap");
            }
        };
    }
1073458
public static <K,V,M extends Map<K,V>> Stream<Map.Entry<K,V>> entriesOf( M map)
    {
    return
      map == null
      ? Stream.empty()
      : map.entrySet().stream();
    }
363906
public static <K, V> Entry<K, V> entry(final K key, final V value) {
        return new SimpleImmutableEntry<K, V>(key, value);
    }
825957
@Override
  public LaxImmutableMapBuilder<K, V> orderEntriesByValue(Comparator<? super V> valueComparator) {
    this.immutableMapEntryOrdering = checkNotNull(valueComparator);
    return this;
  }
191059
public static <K, V> Map<K, V> ofMap(Object... items) {
        HashMap<K, V> map = new LinkedHashMap<>(Math.max(1, items.length / 2));
        int len = items.length / 2;
        for (int i = 0; i < len; i++) {
            map.put((K) items[i * 2], (V) items[i * 2 + 1]);
        }
        return map;
    }
738831
public <A extends Appendable> A appendTo(A appendable, Iterable<? extends Entry<?, ? extends Collection<?>>> entries)
			throws IOException {
		//    checkNotNull(appendable);
		Iterator<? extends Entry<?, ? extends Collection<?>>> iterator = entries.iterator();
		if (iterator.hasNext()) {
			Entry<?, ? extends Collection<?>> entry = iterator.next();
			appendable.append(toString(entry.getKey()));
			appendable.append(keyValueSeparator);
			entryJoiner.appendTo(appendable, entry.getValue());
			while (iterator.hasNext()) {
				appendable.append(separator);
				Entry<?, ? extends Collection<?>> e = iterator.next();
				appendable.append(toString(e.getKey()));
				appendable.append(keyValueSeparator);
				entryJoiner.appendTo(appendable, e.getValue());
			}
		}
		return appendable;
	}
1372053
@Override
	public Iterator<Map.Entry<K, V>> iterator() {
		return Collections.unmodifiableSet(state.entrySet()).iterator();
	}