TODO: more tests
975353
public static boolean alg_87(int[] blz, int[] number) {
        // Ausnahme
        int[] temp = number.clone();
        if (number[2] == 9) {
            return alg_51(blz, number);
        }

        // Methode A
        int[] tab1 = new int[]{0, 4, 3, 2, 6};
        int[] tab2 = new int[]{7, 1, 5, 9, 8};

        int i = 3;
        while (number[i] == 0) {
            i++;
        }
        int c2 = (i + 1) % 2;
        int d2 = 0;
        int a5 = 0;
        int p;
        while (i < 9) {
            switch (number[i]) {
                case 0:
                    number[i] = 5;
                    break;
                case 1:
                    number[i] = 6;
                    break;
                case 5:
                    number[i] = 10;
                    break;
                case 6:
                    number[i] = 1;
                    break;
            }
            if (c2 == d2) {
                if (number[i] > 5) {
                    if (c2 == 0 && d2 == 0) {
                        c2 = 1;
                        d2 = 1;
                        a5 = a5 + 6 - (number[i] - 6);
                    } else {
                        c2 = 0;
                        d2 = 0;
                        a5 = a5 + number[i];
                    }
                } else {
                    if (c2 == 0 && d2 == 0) {
                        c2 = 1;
                        a5 = a5 + number[i];
                    } else {
                        c2 = 0;
                        a5 = a5 + number[i];
                    }
                }
            } else {
                if (number[i] > 5) {
                    if (c2 == 0) {
                        c2 = 1;
                        d2 = 0;
                        a5 = a5 - 6 + (number[i] - 6);
                    } else {
                        c2 = 0;
                        d2 = 1;
                        a5 = a5 - number[i];
                    }
                } else {
                    if (c2 == 0) {
                        c2 = 1;
                        a5 = a5 - number[i];
                    } else {
                        c2 = 0;
                        a5 = a5 - number[i];
                    }
                }
            }
            i++;
        }

        while (a5 < 0 || a5 > 4) {
            if (a5 > 4) {
                a5 = a5 - 5;
            } else {
                a5 = a5 + 5;
            }
        }

        if (d2 == 0) {
            p = tab1[a5];
        } else {
            p = tab2[a5];
        }

        if (p == number[9]) {
            return true;
        }

        if (number[3] == 0) {
            if (p > 4) {
                p = p - 5;
            } else {
                p = p + 5;
            }
            if (p == number[9]) {
                return true;
            }
        }
        // Ende Methode A

        number = temp;
        // Methode B
        if (alg_33(blz, number)) {
            return true;
        }

        // Methode C
        int sum = addProducts(number, 4, 8, new int[]{6, 5, 4, 3, 2}, false);
        int crc = (7 - (sum % 7)) % 7;
        return number[9] == crc;
    }
620848
public void assertOneOrMore(final String propertyName,
            final PropertyList properties) throws ValidationException {

        if (properties.getProperties(propertyName).size() < 1) {
            throw new ValidationException(ASSERT_ONE_OR_MORE_MESSAGE, new Object[] {propertyName});
        }
    }
924221
function(param_, test) {
  var param = param_.replace(/\s+/g, '')
    , cap;

  if (param === 'even') {
    param = '2n+0';
  } else if (param === 'odd') {
    param = '2n+1';
  } else if (param.indexOf('n') === -1) {
    param = '0n' + param;
  }

  cap = /^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(param);

  return {
    group: cap[1] === '-'
      ? -(cap[2] || 1)
      : +(cap[2] || 1),
    offset: cap[4]
      ? (cap[3] === '-' ? -cap[4] : +cap[4])
      : 0
  };
}
120391
def run
      puts (1..tests.length).to_s
      tests.each_with_index do |test, i|
        begin
          if test.is_ok?
            ok(test, i)
          else
            not_ok(test, i)
          end
        rescue Sequel::DatabaseError
          puts $!.sql
          raise $!
        end
      end
    end
1037898
@Override
    public boolean matches(IAtom atom) {
        boolean val = false;
        boolean matchesLeft = left.matches(atom);
        if (right != null) {
            if ("and".equals(operator) && matchesLeft) {
                boolean matchesRight = right.matches(atom);
                val = matchesLeft && matchesRight;
            } else if ("or".equals(operator)) {
                boolean matchesRight = right.matches(atom);
                val = matchesLeft || matchesRight;
            }
        } else {
            if ("not".equals(operator)) {
                val = (!matchesLeft);
            } else {
                val = matchesLeft;
            }
        }
        return val;
    }
1329082
function assertEqualsDelta(msg, expected, actual, epsilon) {
	var args = this.argsWithOptionalMsg_(arguments, 4);
	jstestdriver.assertCount++;
	msg = args[0];
	expected = args[1];
	actual = args[2];
	epsilon = args[3];

	if (!compareDelta_(expected, actual, epsilon)) {
		this.fail(msg + 'expected ' + epsilon + ' within ' +
							this.prettyPrintEntity_(expected) +
							' but was ' + this.prettyPrintEntity_(actual) + '');
	}
	return true;
}
681861
private boolean matches7005( List<ApiDifference> apiDiffs )
    {
        throwIfMissing( false, true, false, true );

        ApiDifference firstDiff = apiDiffs.get( 0 );
        String methodSig = removeVisibilityFromMethodSignature( firstDiff );
        if ( !SelectorUtils.matchPath( method, methodSig ) )
        {
            return false;
        }

        String newMethodSig = getNewMethodSignature( methodSig, apiDiffs );
        return SelectorUtils.matchPath( to, newMethodSig );
    }
1147465
function(input) {
		var needstesting = !this._matches.length;
		if (needstesting || this._matches.every(function(match) {
			return match.$instanceid !== input.$instanceid;
		})) {
			return this._maybeinput(input);
		}
		return false;
	}
1197742
public void assertAtLeastOneDefined(final String param1, final String... moreParams) {
    if (!isPresent(param1)) {
      for (final String moreParam : moreParams) {
        if (isPresent(moreParam)) {
          return;
        }
      }
      final List<String> paramsForError = Lists.newArrayList();
      paramsForError.add(param1);
      paramsForError.addAll(Arrays.asList(moreParams));
      throw new ParameterException(
          String.format("At least one of %s must be defined.",
              StringUtils.CommaSpaceJoiner.join(paramsForError)));
    }
  }
605914
private boolean areLemmasSame() {
    String previousLemma = anTokReadings[0].getLemma();
    if (previousLemma == null) {
      for (AnalyzedToken element : anTokReadings) {
        if (element.getLemma() != null) {
          return false;
        }
      }
      return true;
    }
    for (AnalyzedToken element : anTokReadings) {
      if (!previousLemma.equals(element.getLemma())) {
        return false;
      }
    }
    return true;
  }
324668
function (match) {
        assertType(match, Function);

        for (var i = 0, len = this.length; i < len; i++) {
            if (match(this[i]) === false) {
                return false;
            }
        }

        return true;
    }
98949
function (/*util*/) {

      function compare(actual, expected) {
        return {
          pass: actual instanceof Error && ('' + actual).indexOf(expected) >= 0
        }
      }

      return {compare: compare}
    }
165979
private void prepareNext()
    {
        hasNext = false;
        while (iterator.hasNext())
        {
            next = iterator.next();
            if (predicate.test(next))
            {
                hasNext = true;
                break;
            }
        }
    }
699422
function sample(test, asap, minDuration, sampleSize, done) {
    var count = 0;
    var totalDuration = 0;
    var sampleDurations = [];
    next();
    function next() {
        measure(function (done) {
            test(asap, done);
        }, function (error, results, duration) {
            if (error) {
                done(error);
            }
            if (sampleDurations.length < sampleSize) {
                sampleDurations.push(duration);
            } else if (Math.random() < 1 / count) {
                sampleDurations.splice(Math.floor(Math.random() * sampleDurations.length), 1);
                sampleDurations.push(duration);
            }
            totalDuration += duration;
            count++;
            if (totalDuration >= minDuration) {
                done(null, {
                    name: test.name,
                    subjectName: asap.name,
                    count: count,
                    totalDuration: totalDuration,
                    averageFrequency: count / totalDuration,
                    averageDuration: totalDuration / count,
                    averageOpsHz: count / totalDuration,
                    sampleDurations: sampleDurations
                });
            } else {
                next();
            }
        });
    }
}
843216
private List<TestCaseDef> extendBaseCases( FunctionInputDef inputDef, VarTupleSet validTuples, Iterator<TestCaseDef> baseCases)
    {
    List<TestCaseDef> testCases = new ArrayList<TestCaseDef>();
    
    // For each base test case...
    while( baseCases.hasNext())
      {
      TestCaseDef testCase = baseCases.next();
      logger_.debug( "Extending base test case={}", testCase);

      // Complete all variable bindings.
      if( makeComplete( testCase, validTuples, getVarsRemaining( inputDef, testCase)))
        {
        logger_.debug( "Completed test case={}", testCase);
        validTuples.used( testCase);
        testCases.add( testCase);
        }
      else
        {
        logger_.debug( "Can't complete test case={}", testCase);
        }
      }

    return testCases;
   }
520175
function(test) {
      // Make a new row if needed
      if (!test._row) {
        var trow = jsl.$('test_row_template');
        if (!trow) return;

        test._row = trow.cloneNode(true);
        test._row.style.display = '';
        test._row.id = '';
        test._row.onclick = function() {JSLitmus._queueTest(test);};
        test._row.title = 'Run ' + test.name + ' test';
        trow.parentNode.appendChild(test._row);
        test._row.cells[0].innerHTML = test.name;
      }

      var cell = test._row.cells[1];
      var cns = [test.loopArg ? 'test_looping' : 'test_nonlooping'];

      if (test.error) {
        cns.push('test_error');
        cell.innerHTML =
        '<div class="error_head">' + test.error + '</div>' +
        '<ul class="error_body"><li>' +
          jsl.join(test.error, ': ', '</li><li>') +
          '</li></ul>';
      } else {
        if (test.running) {
          cns.push('test_running');
          cell.innerHTML = 'running';
        } else if (jsl.indexOf(JSLitmus._queue, test) >= 0) {
          cns.push('test_pending');
          cell.innerHTML = 'pending';
        } else if (test.count) {
          cns.push('test_done');
          var hz = test.getHz(jsl.$('test_normalize').checked);
          cell.innerHTML = hz != Infinity ? hz : '&infin;';
          cell.title = 'Looped ' + test.count + ' times in ' + test.time + ' seconds';
        } else {
          cell.innerHTML = 'ready';
        }
      }
      cell.className = cns.join(' ');
    }
660134
private DeferredComparison compareAttributeExplicitness(final Attr control,
                                                            final XPathContext controlContext,
                                                            final Attr test,
                                                            final XPathContext testContext) {
        return new DeferredComparison() {
            @Override
            public ComparisonState apply() {
                return compare(new Comparison(ComparisonType.ATTR_VALUE_EXPLICITLY_SPECIFIED,
                                              control, getXPath(controlContext),
                                              control.getSpecified(), getParentXPath(controlContext),
                                              test, getXPath(testContext),
                                              test.getSpecified(), getParentXPath(testContext)));
            }
        };
    }