Creates a new instance of {@link PlainChangesLogImpl} by copying metadata from originalLog
instance with Items and PairID provided. Metadata will be copied excluding PairID.

@param items
@param originalLog
@return
346103
public static PlainChangesLogImpl createCopy(List<ItemState> items, String pairId, PlainChangesLog originalLog)
   {
      if (originalLog.getSession() != null)
      {
         return new PlainChangesLogImpl(items, originalLog.getSession().getId(), originalLog.getEventType(), pairId,
            originalLog.getSession());
      }
      return new PlainChangesLogImpl(items, originalLog.getSessionId(), originalLog.getEventType(), pairId, null);
   }
256160
public static List<Item> toItemList(List<Map<String, AttributeValue>> items) {
        if (items == null) {
            return Collections.emptyList();
        }
        List<Item> result = new ArrayList<Item>(items.size());
        for (Map<String, AttributeValue> item : items) {
            result.add(toItem(item));
        }
        return result;
    }
1173808
public void mapPossibleTypes(@Nullable Iterable<Item> items) {
        if (items != null && mFastAdapter != null) {
            for (Item item : items) {
                mFastAdapter.registerTypeInstance(item);
            }
        }
    }
891953
@RequestMapping(value = "changelog/{uuid}/files", method = RequestMethod.GET)
    public GitChangeLogFiles changeLogFiles(@PathVariable String uuid) {
        // Gets the change log
        GitChangeLog changeLog = getChangeLog(uuid);
        // Cached?
        GitChangeLogFiles files = changeLog.getFiles();
        if (files != null) {
            return files;
        }
        // Loads the files
        files = gitService.getChangeLogFiles(changeLog);
        // Stores in cache
        logCache.put(uuid, changeLog.withFiles(files));
        // OK
        return files;
    }
980237
public T match(Collection<I> items)
    {
        for (I item : items)
        {
            T match = match(item);
            if (match != null)
            {
                return match;
            }
        }
        return null;
    }
1186167
public static String toNameList(Collection<? extends Item> items) {
        StringBuilder buf = new StringBuilder();
        for (Item item : items) {
            if(buf.length()>0)
                buf.append(", ");
            buf.append(item.getFullName());
        }
        return buf.toString();
    }
1094217
@SuppressWarnings("unchecked")
	private void mergeResponsesArrayList(ArrayList<Object> originalList, ArrayList<Object> shardList)
			throws IOException {
		// get keys from original
		HashMap<String, Object> originalKeyList = new HashMap<>();
		for (Object item : originalList) {
			if (item instanceof NamedList<?>) {
				NamedList<Object> itemList = (NamedList<Object>) item;
				Object key = itemList.get("key");
				if ((key != null) && (key instanceof String)) {
					originalKeyList.put((String) key, item);
				}
			}
		}
		for (Object item : shardList) {
			if (item instanceof NamedList<?>) {
				NamedList<Object> itemList = (NamedList<Object>) item;
				Object key = itemList.get("key");
				// item with key
				if ((key != null) && (key instanceof String)) {
					// merge
					if (originalKeyList.containsKey(key)) {
						Object originalItem = originalKeyList.get(key);
						if (originalItem.getClass().equals(item.getClass())) {
							mergeResponsesNamedList((NamedList<Object>) originalItem, (NamedList<Object>) item);
						} else {
							// ignore?
						}
						// add
					} else {
						Object clonedItem = adjustablePartsCloned(item);
						originalList.add(clonedItem);
						originalKeyList.put((String) key, clonedItem);
					}
				} else {
					originalList.add(item);
				}
			} else {
				originalList.add(item);
			}
		}
	}
616509
public static Expression asImmutableList(Iterable<? extends Expression> items) {
    ImmutableList<Expression> copy = ImmutableList.copyOf(items);
    if (copy.size() < MethodRef.IMMUTABLE_LIST_OF.size()) {
      return MethodRef.IMMUTABLE_LIST_OF.get(copy.size()).invoke(copy);
    }
    ImmutableList<Expression> explicit = copy.subList(0, MethodRef.IMMUTABLE_LIST_OF.size());
    Expression remainder =
        asArray(OBJECT_ARRAY_TYPE, copy.subList(MethodRef.IMMUTABLE_LIST_OF.size(), copy.size()));
    return MethodRef.IMMUTABLE_LIST_OF_ARRAY.invoke(
        Iterables.concat(explicit, ImmutableList.of(remainder)));
  }
238616
public static Defaultable<Boolean> ifAllExplicitlySet(Defaultable<?>... items) {
        return bool(() -> {
            for (Defaultable<?> item : items) {
                if (!item.isExplicit()) {
                    return false;
                }
            }
            return true;
        });
    }
1122801
public boolean addItems(Collection<T> items) {
        if (items.isEmpty()) return false;
        int previousSize = getItemCount();
        if (mListItems.addAll(items)) {
            notifyItemRangeInserted(previousSize, items.size());
            return true;
        }
        return false;
    }
845925
public static <T> Iterable<PSArray<T>> create(Iterable<T> items, final Comparator<T> comparator) {
        MutableArray<T> initial = MutableArrayFromIterable.create(items);
        GoodSortingAlgorithm.getInstance().sort(initial, comparator);
        return IterableUsingStatusUpdater.create(initial, new Updater<PSArray<T>>() {
            @Override
            public PSArray<T> getUpdatedOrNull(PSArray<T> current) {
                MutableArray<T> next = MutableArrayFromIterable.create(current);
                boolean success = NextPermutation.step(next, comparator);
                return success ? next : null;
            }
        });
    }
917505
private SoyList newListFromIterable(Iterable<?> items) {
    // Create a list backed by a Java list which has eagerly converted each value into a lazy
    // value provider. Specifically, the list iteration is done eagerly so that the lazy value
    // provider can cache its value.
    ImmutableList.Builder<SoyValueProvider> builder = ImmutableList.builder();
    for (Object item : items) {
      builder.add(convertLazy(item));
    }
    return ListImpl.forProviderList(builder.build());
  }
1316037
@SafeVarargs
    public static <T> T mode(final T... items) {
        if (ArrayUtils.isNotEmpty(items)) {
            final HashMap<T, MutableInt> occurrences = new HashMap<>(items.length);
            for (final T t : items) {
                final MutableInt count = occurrences.get(t);
                if (count == null) {
                    occurrences.put(t, new MutableInt(1));
                } else {
                    count.increment();
                }
            }
            T result = null;
            int max = 0;
            for (final Map.Entry<T, MutableInt> e : occurrences.entrySet()) {
                final int cmp = e.getValue().intValue();
                if (cmp == max) {
                    result = null;
                } else if (cmp > max) {
                    max = cmp;
                    result = e.getKey();
                }
            }
            return result;
        }
        return null;
    }
189182
public static <T> Source<T> from(T... items) {
        return from(Arrays.asList(items));
    }
127681
public boolean addAll(Collection<T> items)
	{
		boolean wasAllAdded = true;
		for (T item : items)
		{
			if(!add(item))
				wasAllAdded = false;
		}
		
		return wasAllAdded;
	}
721631
@SuppressWarnings("unchecked")
    @NonNull
    public static Set<String> nonNullSet(@Nullable String[] items) {
        return items == null || items.length == 0
                ? Collections.<String>emptySet()
                : new HashSet<String>(asList(items));
    }
504231
public static <T> ImmutableMap<T, Integer> indexMap(Iterable<? extends T> items) {
    final ImmutableMap.Builder<T, Integer> ret = ImmutableMap.builder();
    int idx = 0;
    for (final T item : items) {
      ret.put(item, idx++);
    }
    return ret.build();
  }