Converts array of something to non-null set.

@param firstItem  the first required source item.
@param otherItems other source items to convert, can be {@code null}.
@return non-null, set of something.
541982
@SuppressWarnings("unchecked")
    @NonNull
    public static Set<String> nonNullSet(@NonNull String firstItem, @Nullable String[] otherItems) {
        final HashSet<String> set = new HashSet<String>();
        set.add(firstItem);
        if (otherItems != null) {
            set.addAll(asList(otherItems));
        }
        return set;
    }
15638
@Nullable
    public T getOrElse(@Nullable T other) {
        return throwable == null ? value : other;
    }
210088
static boolean isItemInArray(Object item, Object[] arrayOfValues) {
        if (arrayOfValues == null) {
            return false;
        }

        for (Object value : arrayOfValues) {
            if (Objects.equals(value, item)) {
                return true;
            }
        }
        return false;
    }
1112413
private static <T> T[] removeNull(T[] items) {
		int count = 0;
		for (int i = 0; i != items.length; ++i) {
			if (items[i] == null) {
				count = count + 1;
			}
		}
		if (count == 0) {
			return items;
		} else {
			T[] rs = java.util.Arrays.copyOf(items, items.length - count);
			for (int i = 0, j = 0; i != items.length; ++i) {
				T item = items[i];
				if (item != null) {
					rs[j++] = item;
				}
			}

			return rs;
		}
	}
736819
public static ListValue of(Blob first, Blob... other) {
    return newBuilder().addValue(first, other).build();
  }
630373
public void setItems (Array<T> newItems) {
		items.clear();
		items.addAll(newItems);
		currentIndex = 0;
		invalidateDataSet();
	}
85642
@SuppressWarnings("unchecked")
	public static <T> T firstNonNull(T... array) {
		if (isNotEmpty(array)) {
			for (final T val : array) {
				if (null != val) {
					return val;
				}
			}
		}
		return null;
	}
1144099
public T first(String param) {
        List<T> items = parts.get(param);
        if (items == null) return null;
        return items.get(0);
    }
321679
public function itemsFilterFirst($params) {
		$params2 = $params;
		$params2['limit'] = 1;
		$list = $this->itemsFilter($params2);
		if (empty($list)) {
			return NULL;
		}
		$item = reset($list);
		return $item;
	}
529572
public static ListValue of(LatLng first, LatLng... other) {
    return newBuilder().addValue(first, other).build();
  }
404452
public T withSubItems(IDrawerItem... subItems) {
        if (mSubItems == null) {
            mSubItems = new ArrayList<>();
        }
        for (IDrawerItem subItem : subItems) {
            subItem.withParent(this);
        }
        Collections.addAll(mSubItems, subItems);
        return (T) this;
    }
778772
public static <A extends FastItemAdapter<Item>, Item extends IItem> A set(final A adapter, final List<Item> items) {
        return set(adapter, items, new DiffCallbackImpl<Item>());
    }
907395
@SuppressWarnings("unchecked")
  @Override
  public Set<LeftT> alignedToRightItem(final Object rightItem) {
    if (rightToLeft.containsKey(rightItem)) {
      return rightToLeft.get((RightT)rightItem);
    } else {
      return ImmutableSet.of();
    }
  }
785937
public T removeFirst() {
		if (isEmpty()) {
			return null;
		}
		T firstElement = elements[firstIndex];
		elements[firstIndex] = null;
		firstIndex = incrementIndex(firstIndex, 0);
		return firstElement;
	}
275542
@SafeVarargs
  public static <T> RubyArray<T> p(T first, T... others) {
    RubyArray<T> ra = new RubyArray<>();
    out.print("[");
    ra.add(p(first, false));
    Arrays.asList(others).forEach(item -> {
      out.print(", ");
      ra.add(p(item, false));
    });
    out.print("]");
    out.println();
    return ra;
  }
878859
function (other) {
        assertNotNull(other);

        var c = collectionCount(other);

        if (c !== -1) {
            if (this.count() === 0) {
                return c > 0;
            }

            // faster if other is a hashset (and we're using same equality comparer)
            else if (areEqualityComparersEqual(this, other)) {
                if (this.count() >= c) {
                    return false;
                }

                // this has strictly less than number of items in other, so the following
                // check suffices for proper subset.
                else {
                    return containsAllElements(other, this);
                }
            }
        }

        var result = checkUniqueAndUnfoundElements(this, other, false);
        return (result.uniqueCount === this.count() && result.unfoundCount > 0);
    }
683114
public void combine(SimpleItem other)
    {
        for (Map.Entry<String, Integer> entry : other.labelMap.entrySet())
        {
            addLabel(entry.getKey(), entry.getValue());
        }
    }