Checks if the stack has the same element more than once.

@param distinctQueryStack
@return true is there are duplicates else false
8251
public boolean duplicatesInStack(LinkedList<SchemaTableTree> distinctQueryStack) {
        Set<SchemaTable> alreadyVisited = new HashSet<>();
        for (SchemaTableTree schemaTableTree : distinctQueryStack) {
            if (!alreadyVisited.contains(schemaTableTree.getSchemaTable())) {
                alreadyVisited.add(schemaTableTree.getSchemaTable());
            } else {
                return true;
            }
        }
        return false;
    }
1188035
final boolean tryPushStack(Completion c) {
    Completion h = stack;
    lazySetNext(c, h);
    return U.compareAndSwapObject(this, STACK, h, c);
  }
284221
public T uniqueResult()
	{
		if (list == null || list.size() == 0)
			return null;
		else if (list.size() == 1)
			return list.get(0);
		else
			throw new IllegalArgumentException("Asked for unique result but resultset contained " + list.size() + " results!");
	}
982304
public static boolean checkDuplicateElements(DMatrixSparseCSC A ) {
        A = A.copy(); // create a copy so that it doesn't modify A
        A.sortIndices(null);
        return !checkSortedFlag(A);
    }
883316
private static boolean shouldHasUniqueValues(List<Field> dataFields) {
        Set<String> dataValues = new HashSet<>();
        for (Field field : dataFields) {
            String value = field.getAnnotation(Plugin.Data.class).value();
            if (dataValues.contains(value)) {
                return false;
            }
            dataValues.add(value);
        }
        return true;
    }
591120
@Override
    public ListT<W,T> distinct() {

        return (ListT<W,T>) FoldableTransformerSeq.super.distinct();
    }
646615
public boolean isMultipleSelect()
        throws CacheReloadException
    {
        final boolean ret;
        if (isRoot()) {
            ret = this.multipleSelect;
        } else {
            ret = getParentClassification().isMultipleSelect();
        }
        return ret;
    }
857632
public boolean hasMoreElements()
    {
        try
        {
            if (!hasCalledCheck)
            {
                hasCalledCheck = true;
                hasNext = resultSetAndStatment.m_rs.next();
            }
        }
        catch (SQLException e)
        {
            LoggerFactory.getDefaultLogger().error(e);
            //releaseDbResources();
            hasNext = false;
        }
        finally
        {
            if(!hasNext)
            {
                releaseDbResources();
            }
        }
        return hasNext;
    }
1307142
public static boolean containsOccurrences(
      Multiset<?> superMultiset, Multiset<?> subMultiset) {
    checkNotNull(superMultiset);
    checkNotNull(subMultiset);
    for (Entry<?> entry : subMultiset.entrySet()) {
      int superCount = superMultiset.count(entry.getElement());
      if (superCount < entry.getCount()) {
        return false;
      }
    }
    return true;
  }
395815
@Override
    public boolean isOrderDeterministic() {
        if ( ! hasTopLevelScans()) {
            // This currently applies to parent queries that do all their
            // scanning in subqueries and so take on the order determinism of
            // their subqueries. This might have to be rethought to allow
            // ordering in parent queries to effect determinism of unordered
            // "FROM CLAUSE" subquery results.
            return true;
        }

        if (hasAOneRowResult()) {
            return true;
        }

        if ( ! hasOrderByColumns() ) {
            return false;
        }

        // The nonOrdered expression list is used as a short-cut
        // -- if an expression has been determined to be
        // non-ordered when encountered as a GROUP BY expression,
        // it will also be non-ordered when encountered in the select list.
        ArrayList<AbstractExpression> nonOrdered = new ArrayList<>();

        if (isGrouped()) {
            // Does the ordering of a statements's GROUP BY columns
            // ensure determinism?
            // All display columns and order-by expressions
            // are functionally dependent on the GROUP BY
            // columns even if the display column's values
            // are not ordered or unique,
            // so ordering by ALL of the GROUP BY columns is enough
            // to get full determinism,
            // EVEN if ordering by other (dependent) expressions,
            // regardless of the placement of non-GROUP BY expressions
            // in the ORDER BY list.
            if (orderByColumnsDetermineAllColumns(m_groupByColumns, nonOrdered)) {
                return true;
            }

            if (orderByColumnsDetermineAllDisplayColumns(nonOrdered)) {
                return true;
            }

        }
        else {
            if (orderByColumnsDetermineAllDisplayColumns(nonOrdered)) {
                return true;
            }

            if (orderByColumnsCoverUniqueKeys()) {
                return true;
            }
        }
        return false;
    }
816925
def is_duplicate_of(self, other):
        """"""
        if super(Spectrum, self).is_duplicate_of(other):
            return True
        row_matches = 0
        for ri, row in enumerate(self.get(self._KEYS.DATA, [])):
            lambda1, flux1 = tuple(row[0:2])
            if (self._KEYS.DATA not in other or
                    ri > len(other[self._KEYS.DATA])):
                break
            lambda2, flux2 = tuple(other[self._KEYS.DATA][ri][0:2])
            minlambdalen = min(len(lambda1), len(lambda2))
            minfluxlen = min(len(flux1), len(flux2))
            if (lambda1[:minlambdalen + 1] == lambda2[:minlambdalen + 1] and
                    flux1[:minfluxlen + 1] == flux2[:minfluxlen + 1] and
                    float(flux1[:minfluxlen + 1]) != 0.0):
                row_matches += 1
            # Five row matches should be enough to be sure spectrum is a dupe.
            if row_matches >= 5:
                return True
            # Matches need to happen in the first 10 rows.
            if ri >= 10:
                break
        return False
679334
boolean isUniqueWithColumns(int[] cols) {

        if (constType != UNIQUE || core.mainCols.length != cols.length) {
            return false;
        }

        return ArrayUtil.haveEqualSets(core.mainCols, cols, cols.length);
    }
884425
public boolean isUniqueWithExprs(Expression[] indexExprs2) {
        if (constType != UNIQUE || (indexExprs == null) || ! indexExprs.equals(indexExprs2)) {
            return false;
        }
        return true;
    }
134672
private boolean isMoreToReadBeforeReadingRecord(
      final SequenceOffsetType recordSequenceNumber,
      final SequenceOffsetType endSequenceNumber
  )
  {
    final int compareToEnd = createSequenceNumber(recordSequenceNumber)
        .compareTo(createSequenceNumber(endSequenceNumber));

    return isEndOffsetExclusive() ? compareToEnd < 0 : compareToEnd <= 0;
  }
824776
public boolean hasMoreElements()
    {
        try {
            return hasMoreElementsR();
        } catch (NoMoreElementsException e) {
            // FFDCFilter.processException(e, CLASS_NAME + ".hasMoreElements", "131", this);
            return false;
        } catch (EnumeratorException e) {
            // FFDCFilter.processException(e, CLASS_NAME + ".hasMoreElements", "134", this);
            throw new RuntimeException(e.toString());
        } catch (NoSuchObjectException e) {
            // FFDCFilter.processException(e, CLASS_NAME + ".hasMoreElements", "137", this);
            throw new IllegalStateException("Cannot access finder result outside transaction");
        } catch (RemoteException e) {
            // FFDCFilter.processException(e, CLASS_NAME + ".hasMoreElements", "140", this);
            throw new RuntimeException(e.toString());
        }
    }
494014
public boolean matchesStackLines(List<StackLine> targetStackLines) {
        if (targetStackLines.size() != getStackLines().size()) {
            return false;
        }
        for (int i = 0; i < targetStackLines.size(); i++) {
            StackLine targetLine = targetStackLines.get(i);
            StackLine line = getStackLines().get(i);
            if (!targetLine.getMethod().getKey().equals(line.getMethod().getKey())) {
                return false;
            }
            if (targetLine.getCodeBodyIndex() != line.getCodeBodyIndex()) {
                return false;
            }
        }
        return true;
    }
39109
private void validateDepNameUniqueness(final List<TriggerDependencyBean> dependencies) {
    final Set<String> seen = new HashSet<>();
    for (final TriggerDependencyBean dep : dependencies) {
      // set.add() returns false when there exists duplicate
      Preconditions.checkArgument(seen.add(dep.getName()), String.format("duplicate dependency"
          + ".name %s found, dependency.name should be unique", dep.getName()));
    }
  }