Fails if the element does not have the given count.
548580
public final void hasCount(@NullableDecl Object element, int expectedCount) {
    checkArgument(expectedCount >= 0, "expectedCount(%s) must be >= 0", expectedCount);
    int actualCount = ((Multiset<?>) actual()).count(element);
    check("count(%s)", element).that(actualCount).isEqualTo(expectedCount);
  }
1256127
def remove(self, element):
        
        if element not in self._counts:
            raise KeyError(element)
        elif self._counts[element] == 1:
            newc = self._counts.remove(element)
        else:
            newc = self._counts.set(element, self._counts[element] - 1)
        return PBag(newc)
1171630
def contains_element(self, element):
        
        return (element in self.element_finder) and \
            (self.element_finder[element][1] != self.INVALID)
322255
def element_is_empty(elem_to_parse, element_path=None):
    

    element = get_element(elem_to_parse, element_path)

    if element is None:
        return True

    is_empty = (
        (element.text is None or not element.text.strip()) and
        (element.tail is None or not element.tail.strip()) and
        (element.attrib is None or not len(element.attrib)) and
        (not len(element.getchildren()))
    )

    return is_empty
20328
def _check_not_tuple_of_2_elements(obj, obj_name='obj'):
    """"""
    if not isinstance(obj, tuple) or len(obj) != 2:
        raise TypeError('%s must be a tuple of 2 elements.' % obj_name)
823324
public static void notEmpty(final Collection<?> collection, final String collectionName) {
        notNull(collection, collectionName);

        if (collection.isEmpty()) {
            throw new IllegalArgumentException("expecting " + maskNullArgument(collectionName) + " to contain 1 or more elements");
        }
    }
1119279
def skip(self, count):
        '''
        
        '''
        self._initialize()
        skipped = 0
        if not self._exhausted():
            skipped = min(count, self._last_index() - self._current_index)
            self._current_index += skipped
        return skipped
1141880
private static int countTrue(final boolean... b) {
        if (b == null) {
            return 0;
        }
        int count = 0;
        for (boolean bb : b) {
            if (bb) {
                ++count;
            }
        }
        return count;
    }
106729
def element_count(self):
        
        result = conf.lib.clang_getNumElements(self)
        if result < 0:
            raise Exception('Type does not have elements.')

        return result
1033023
def skip(self, count):
        '''
        
        '''
        self._get_ready()
        skipped = 0
        for i in range(count):
            if self.mutate():
                skipped += 1
            else:
                break
        return skipped
500558
public static boolean contains(Iterator<?> iterator, @Nullable Object element) {
    return any(iterator, equalTo(element));
  }
302824
public static int countSameElements(byte[] arra, int start, byte[] arrb) {

        int k     = 0;
        int limit = arra.length - start;

        if (limit > arrb.length) {
            limit = arrb.length;
        }

        for (int i = 0; i < limit; i++) {
            if (arra[i + start] == arrb[i]) {
                k++;
            } else {
                break;
            }
        }

        return k;
    }
804524
public void hasLastElement(@NullableDecl Object element) {
    if (actualAsNavigableSet().isEmpty()) {
      failWithActual("expected to have last element", element);
      return;
    }

    if (!Objects.equal(actualAsNavigableSet().last(), element)) {
      if (actualAsNavigableSet().contains(element)) {
        failWithoutActual(
            simpleFact(
                lenientFormat(
                    "Not true that %s has last element <%s>. "
                        + "It does contain this element, but the last element is <%s>",
                    actualAsString(), element, actualAsNavigableSet().last())));
        return;
      }
      failWithoutActual(
          simpleFact(
              lenientFormat(
                  "Not true that %s has last element <%s>. "
                      + "It does not contain this element, and the last element is <%s>",
                  actualAsString(), element, actualAsNavigableSet().last())));
    }
  }
181035
public static boolean contains(Iterator<?> iterator, Object element) {
        if (iterator != null) {
            while (iterator.hasNext()) {
                Object candidate = iterator.next();
                if (ObjectUtils.nullSafeEquals(candidate, element)) {
                    return true;
                }
            }
        }
        return false;
    }
828846
@Override public int setCount(E element, int count) {
    checkNotNull(element);
    checkNonnegative(count, "count");
    while (true) {
      AtomicInteger existingCounter = Maps.safeGet(countMap, element);
      if (existingCounter == null) {
        if (count == 0) {
          return 0;
        } else {
          existingCounter = countMap.putIfAbsent(element, new AtomicInteger(count));
          if (existingCounter == null) {
            return 0;
          }
          // existingCounter != null: fall through
        }
      }

      while (true) {
        int oldValue = existingCounter.get();
        if (oldValue == 0) {
          if (count == 0) {
            return 0;
          } else {
            AtomicInteger newCounter = new AtomicInteger(count);
            if ((countMap.putIfAbsent(element, newCounter) == null)
                || countMap.replace(element, existingCounter, newCounter)) {
              return 0;
            }
          }
          break;
        } else {
          if (existingCounter.compareAndSet(oldValue, count)) {
            if (count == 0) {
              // Just CASed to 0; remove the entry to clean up the map. If the removal fails,
              // another thread has already replaced it with a new counter, which is fine.
              countMap.remove(element, existingCounter);
            }
            return oldValue;
          }
        }
      }
    }
  }
713664
def assert_element_absent(self, selector, by=By.CSS_SELECTOR,
                              timeout=settings.SMALL_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        self.wait_for_element_absent(selector, by=by, timeout=timeout)
        return True
1147146
public void hasFirstElement(@NullableDecl Object element) {
    if (actualAsNavigableSet().isEmpty()) {
      failWithActual("expected to have first element", element);
      return;
    }

    if (!Objects.equal(actualAsNavigableSet().first(), element)) {
      if (actualAsNavigableSet().contains(element)) {
        failWithoutActual(
            simpleFact(
                lenientFormat(
                    "Not true that %s has first element <%s>. "
                        + "It does contain this element, but the first element is <%s>",
                    actualAsString(), element, actualAsNavigableSet().first())));
        return;
      }
      failWithoutActual(
          simpleFact(
              lenientFormat(
                  "Not true that %s has first element <%s>. "
                      + "It does not contain this element, and the first element is <%s>",
                  actualAsString(), element, actualAsNavigableSet().first())));
    }
  }