Check whether we have a duplicate default statement, or a case which
occurs after a default statement (and, hence, is unreachable).

@param cases
320113
private void checkForDuplicateDefault(List<Stmt.Case> cases) {
		boolean hasDefault = false;
		for(int i=0;i!=cases.size();++i) {
			Stmt.Case c = cases.get(i);
			if (c.getConditions().size() > 0 && hasDefault) {
				syntaxError("unreachable code", c);
			} else if (c.getConditions().size() == 0 && hasDefault) {
				syntaxError("duplicate default label", c);
			} else {
				hasDefault = c.getConditions().size() == 0;
			}
		}
	}
1171679
@Override
	protected List<FieldCase> createCases() {
		List<FieldCase> s = Lists.newArrayList();
		s.add(new FieldCase(range.getMin()));
		// make sure there are three different sizes in the list
		int rndValue = range.getMin() + 1 + random.getInt(range.getRange() - 2);
		s.add(new FieldCase(rndValue));
		s.add(new FieldCase(range.getMax()));
		return s;
	}
311797
private function checkDuplicates(iterable $adapterFactories): void
    {
        $dupes = [];
        foreach ($adapterFactories as $adapter) {
            $type = strtolower($adapter->getType());
            if (array_key_exists($type, $dupes)) {
                throw new DuplicateFilesystemFactoryException($type);
            }

            $dupes[$type] = 1;
        }
    }
1081050
def p_casecontent_statement_default(self, p):
        ''
        p[0] = Case(None, p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
655685
private static void checkDuplicates(ImmutableList<SQLPPTriplesMap> mappings)
            throws DuplicateMappingException {

        Set<SQLPPTriplesMap> mappingSet = new HashSet<>(mappings);

        int duplicateCount = mappings.size() - mappingSet.size();

        /**
         * If there are some triplesMaps, finds them
         */
        if (duplicateCount > 0) {
            Set<String> duplicateIds = new HashSet<>();
            int remaining = duplicateCount;
            for (SQLPPTriplesMap mapping : mappings) {
                if (mappingSet.contains(mapping)) {
                    mappingSet.remove(mapping);
                }
                /**
                 * Duplicate
                 */
                else {
                    duplicateIds.add(mapping.getId());
                    if (--remaining == 0)
                        break;
                }
            }
            //TODO: indicate the source
            throw new DuplicateMappingException(String.format("Found %d duplicates in the following ids: %s",
                    duplicateCount, duplicateIds.toString()));
        }
    }
1175137
protected ProcessInstanceDesc verifyCaseIdExists(String caseId) throws CaseNotFoundException {
        ProcessInstanceDesc pi = runtimeDataService.getProcessInstanceByCorrelationKey(correlationKeyFactory.newCorrelationKey(caseId));
        if (pi == null) {
            throw new CaseNotFoundException("Case with id " + caseId + " was not found"); 
        }
        
        return pi;
    }
964176
public void used( final TestCaseDef testCase)
    {
    // Note: must accumulate tuples into a separate list to avoid ConcurrentModificationException when updating used/unused membership.
    List<Tuple> usedTuples =
      IteratorUtils.toList(
        IteratorUtils.filteredIterator(
          IteratorUtils.chainedIterator(
            unused_.iterator(),
            used_.iterator()),
          tuple -> testCase.usesTuple( tuple)));

    for( Tuple tuple : usedTuples)
      {
      used( tuple);
      }
    }
162783
public void isNotEqualToDefaultInstance() {
    if (actual() != null && actual().equals(actual().getDefaultInstanceForType())) {
      failWithoutActual(
          simpleFact(
              lenientFormat(
                  "Not true that (%s) %s is not a default proto instance. It has no set values.",
                  actual().getClass().getName(), actualAsString())));
    }
  }
898589
private static boolean checkDuplicate(String muri,processNAFVariables vars) {
        boolean re = false;        
       for(String keys:vars.entityMentions.keySet()){
            if (keys.equals(muri)) {
            //if (mtmp.getID().stringValue().equals(muri)) {
                re = true;
                break;
            }
        }
        return re;
    }
922460
public void checkExpectedValidationViolations(
			Set<ConstraintViolation<T>> violations,
			List<String> expectedValidationViolations) {

		if (violations != null && expectedValidationViolations != null) {

			List<String> givenViolations = new ArrayList<String>();
			for (ConstraintViolation<T> violation : violations) {
				givenViolations.add(violation.getMessageTemplate());
			}

			checkViolations(givenViolations, expectedValidationViolations);
		}

	}
1203497
private function _processSwitchDefault() {
		// If we already are in a "case", we remove it from the stack
		if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_CASE || $this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_DEFAULT) {

			// Test if the previous case had a break
			$this->_checkSwitchCaseNeedBreak();

			$this->statementStack->pop();
		}

		// We flag the "SWITCH" stack item as having a default
		$this->statementStack->getCurrentStackItem()->switchHasDefault = true;

		// We store the control statement in the stack
		$stackitem = new StatementItem();
		$stackitem->line = $this->lineNumber;
		$stackitem->type = "DEFAULT";
		$stackitem->name = "default";
		$this->statementStack->push($stackitem);
	}
1276977
private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples, Tuple satisfyingTuple)
    {
    return
      // Compatible tuple found?
      testCase.addCompatible( satisfyingTuple) != null

      // Did this tuple create an infeasible combination?
      && !testCase.isInfeasible()

      // Can also we satisfy any new conditions?
      && makeSatisfied( testCase, tuples);
    }
522441
@Override
    public int compareRowNonUnique(Object[] a, Object[] b, int fieldcount) {

        for (int j = 0; j < fieldcount; j++) {
            int i = colTypes[j].compare(a[j], b[colIndex[j]]);

            if (i != 0) {
                return i;
            }
        }

        return 0;
    }
1293167
public Result.Suites.Suite.Cases.Case createResultSuitesSuiteCasesCase() {
        return new Result.Suites.Suite.Cases.Case();
    }
1260329
public boolean hasReturn(List<Statement> statements) {
        boolean hasReturn = false;
        for (Statement statement : statements) {
            hasReturn = hasReturn || statement.match(new Statement.MatchBlockWithDefault<Boolean>() {
                @Override
                public Boolean _case(Return x) {
                    return true;
                }

                @Override
                public Boolean _default(Statement x) {
                    return false;
                }
            });
        }
        return hasReturn;
    }
1360770
@Override
	public SqlAgentFactory setDefaultMapKeyCaseFormat(final CaseFormat defaultMapKeyCaseFormat) {
		getDefaultProps().put(PROPS_KEY_DEFAULT_MAP_KEY_CASE_FORMAT, defaultMapKeyCaseFormat.toString());
		return this;
	}
84682
private void checkDone() {
    if (doneHandler != null) {
      if (cause != null) {
        doneHandler.handle(new DefaultFutureResult<T>(cause));
      } else {
        if (count == required) {
          doneHandler.handle(new DefaultFutureResult<T>((T) null));
        }
      }
    }
  }