Tabnine Logo
List.containsAll
Code IndexAdd Tabnine to your IDE (free)

How to use
containsAll
method
in
java.util.List

Best Java code snippets using java.util.List.containsAll (Showing top 20 results out of 11,673)

Refine searchRefine arrow

  • List.size
  • Arrays.asList
  • Assert.assertTrue
  • Test.<init>
  • Assert.assertEquals
origin: jenkinsci/jenkins

/**
 * @deprecated apparently unused
 */
@Deprecated
public boolean hasSame(AbstractProject owner, Collection<? extends AbstractProject> projects) {
  List<AbstractProject> children = getChildProjects(owner);
  return children.size()==projects.size() && children.containsAll(projects);
}
origin: hibernate/hibernate-orm

/**
 * compares the dirty fields of an entity with a set of expected values
 */
public static void checkDirtyTracking(Object entityInstance, String... dirtyFields) {
  SelfDirtinessTracker selfDirtinessTracker = (SelfDirtinessTracker) entityInstance;
  assertEquals( dirtyFields.length > 0, selfDirtinessTracker.$$_hibernate_hasDirtyAttributes() );
  String[] tracked = selfDirtinessTracker.$$_hibernate_getDirtyAttributes();
  assertEquals( dirtyFields.length, tracked.length );
  assertTrue( Arrays.asList( tracked ).containsAll( Arrays.asList( dirtyFields ) ) );
}
origin: apache/kylin

public Map<Array<TblColRef>, List<DeriveInfo>> getHostToDerivedInfo(List<TblColRef> rowCols,
    Collection<TblColRef> wantedCols) {
  Map<Array<TblColRef>, List<DeriveInfo>> result = new HashMap<Array<TblColRef>, List<DeriveInfo>>();
  for (Entry<Array<TblColRef>, List<DeriveInfo>> entry : hostToDerivedMap.entrySet()) {
    Array<TblColRef> hostCols = entry.getKey();
    boolean hostOnRow = rowCols.containsAll(Arrays.asList(hostCols.data));
    if (!hostOnRow)
      continue;
    List<DeriveInfo> wantedInfo = new ArrayList<DeriveInfo>();
    for (DeriveInfo info : entry.getValue()) {
      if (wantedCols == null || Collections.disjoint(wantedCols, Arrays.asList(info.columns)) == false) // has any wanted columns?
        wantedInfo.add(info);
    }
    if (wantedInfo.size() > 0)
      result.put(hostCols, wantedInfo);
  }
  return result;
}
origin: jtablesaw/tablesaw

@Test
public void innerJoinInstructorStudentOnAge() {
  Table table1 = createINSTRUCTOR();
  Table table2 = createSTUDENT();
  Table joined = table1.join("Age").inner(true, table2);
  assert(joined.columnNames().containsAll(Arrays.asList(
      "T2.ID", "T2.City", "T2.State", "T2.USID", "T2.GradYear")));
  assertEquals(16, joined.columnCount());
  assertEquals(14, joined.rowCount());
}
origin: googleapis/google-cloud-java

 @Test
 public void testValues() {
  assertThat(
    Arrays.asList(Letter.values()).containsAll(Arrays.asList(Letter.A, Letter.B, Letter.C)));
 }
}
origin: spring-projects/spring-framework

@Override
@SuppressWarnings("unchecked")
public ListBodySpec<E> contains(E... elements) {
  List<E> expected = Arrays.asList(elements);
  List<E> actual = getResult().getResponseBody();
  String message = "Response body does not contain " + expected;
  getResult().assertWithDiagnostics(() ->
      AssertionErrors.assertTrue(message, (actual != null && actual.containsAll(expected))));
  return this;
}
origin: eclipse-vertx/vert.x

@Test
public void testValues() {
 Map<JsonObject, Buffer> map = genJsonToBuffer(100);
 loadData(map, (vertx, asyncMap) -> {
  asyncMap.values(onSuccess(values -> {
   assertEquals(map.values().size(), values.size());
   assertTrue(map.values().containsAll(values));
   assertTrue(values.containsAll(map.values()));
   testComplete();
  }));
 });
 await();
}
origin: apache/hbase

private void assertArchiveFiles(FileSystem fs, List<String> storeFiles, long timeout)
    throws IOException {
 long end = System.currentTimeMillis() + timeout;
 Path archiveDir = HFileArchiveUtil.getArchivePath(UTIL.getConfiguration());
 List<String> archivedFiles = new ArrayList<>();
 // We have to ensure that the DeleteTableHandler is finished. HBaseAdmin.deleteXXX()
 // can return before all files
 // are archived. We should fix HBASE-5487 and fix synchronous operations from admin.
 while (System.currentTimeMillis() < end) {
  archivedFiles = getAllFileNames(fs, archiveDir);
  if (archivedFiles.size() >= storeFiles.size()) {
   break;
  }
 }
 Collections.sort(storeFiles);
 Collections.sort(archivedFiles);
 LOG.debug("Store files:");
 for (int i = 0; i < storeFiles.size(); i++) {
  LOG.debug(i + " - " + storeFiles.get(i));
 }
 LOG.debug("Archive files:");
 for (int i = 0; i < archivedFiles.size(); i++) {
  LOG.debug(i + " - " + archivedFiles.get(i));
 }
 assertTrue("Archived files are missing some of the store files!",
  archivedFiles.containsAll(storeFiles));
}
origin: apache/geode

@Test
public void testFindAll() {
 final List<Integer> numbers = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9);
 // accept all even numbers
 final List<Integer> matches = CollectionUtils.findAll(numbers, number -> (number % 2 == 0));
 assertNotNull(matches);
 assertFalse(matches.isEmpty());
 assertTrue(matches.containsAll(Arrays.asList(0, 2, 4, 6, 8)));
}
origin: apache/kylin

@Test
public void createDirectChildrenCacheTest() {
  Set<Long> cuboidSet = generateCuboidSet();
  Map<Long, List<Long>> directChildrenCache = CuboidStatsUtil.createDirectChildrenCache(cuboidSet);
  Assert.assertTrue(directChildrenCache.get(255L).containsAll(Lists.newArrayList(239L, 159L, 50L)));
  Assert.assertTrue(directChildrenCache.get(159L).contains(6L));
  Assert.assertTrue(directChildrenCache.get(50L).contains(2L));
  Assert.assertTrue(directChildrenCache.get(239L).contains(199L));
  Assert.assertTrue(directChildrenCache.get(199L).contains(6L));
  Assert.assertTrue(directChildrenCache.get(6L).containsAll(Lists.newArrayList(4L, 2L)));
}
origin: languagetool-org/languagetool

private void testOrderingHappened(Language language, String rule_id) throws IOException {
 JLanguageTool languageTool = new JLanguageTool(language);
 SuggestionsOrderer suggestionsOrderer = new SuggestionsOrderer(language, rule_id);
 String word = "wprd";
 String sentence = String.join(" ","a", word, "containing", "sentence");
 LinkedList<String> suggestions = new LinkedList<>();
 suggestions.add("word");
 suggestions.add("weird");
 int startPos = sentence.indexOf(word);
 int wordLength = word.length();
 List<String> suggestionsOrdered = suggestionsOrderer.orderSuggestionsUsingModel(
     suggestions, word, languageTool.getAnalyzedSentence(sentence), startPos, wordLength);
 assertTrue(suggestionsOrdered.containsAll(suggestions));
}
origin: apache/kafka

@Test
public void testParseAndValidateAddressesWithReverseLookup() {
  checkWithoutLookup("127.0.0.1:8000");
  checkWithoutLookup("localhost:8080");
  checkWithoutLookup("[::1]:8000");
  checkWithoutLookup("[2001:db8:85a3:8d3:1319:8a2e:370:7348]:1234", "localhost:10000");
  // With lookup of example.com, either one or two addresses are expected depending on
  // whether ipv4 and ipv6 are enabled
  List<InetSocketAddress> validatedAddresses = checkWithLookup(Arrays.asList("example.com:10000"));
  assertTrue("Unexpected addresses " + validatedAddresses, validatedAddresses.size() >= 1);
  List<String> validatedHostNames = validatedAddresses.stream().map(InetSocketAddress::getHostName)
      .collect(Collectors.toList());
  List<String> expectedHostNames = Arrays.asList("93.184.216.34", "2606:2800:220:1:248:1893:25c8:1946");
  assertTrue("Unexpected addresses " + validatedHostNames, expectedHostNames.containsAll(validatedHostNames));
  validatedAddresses.forEach(address -> assertEquals(10000, address.getPort()));
}
origin: google/ExoPlayer

score = updateScoreForMatch(score, targetTag, tag, 2);
score = updateScoreForMatch(score, targetVoice, voice, 4);
if (score == -1 || !Arrays.asList(classes).containsAll(targetClasses)) {
 return 0;
} else {
 score += targetClasses.size() * 4;
origin: jtablesaw/tablesaw

@Test
public void innerJoinOnPartiallyMismatchedColNames() {
  Table table1 = createANIMALHOMES();
  Table table2 = createDOUBLEINDEXEDPEOPLENameDwellingYearsMoveInDate();
  Table joined = table1.join("Name", "Home", "Age")
      .inner(table2, true,
      "Name", "Dwelling", "Years");
  assert(joined.columnNames().containsAll(Arrays.asList("Name", "Home", "Age")));
  assertEquals(7, joined.columnCount());
  assertEquals(2, joined.rowCount());
}
origin: weibocom/motan

/**
 * 判断两个list中的url是否一致。 如果任意一个list为空,则返回false; 此方法并未做严格互相判等
 *
 * @param urls1
 * @param urls2
 * @return
 */
public static boolean isSame(List<URL> urls1, List<URL> urls2) {
  if (urls1 == null || urls2 == null) {
    return false;
  }
  if (urls1.size() != urls2.size()) {
    return false;
  }
  return urls1.containsAll(urls2);
}
origin: gocd/gocd

@Test
public void testModificationsSince() throws Exception {
  List<Modification> modifications = new ArrayList<>();
  modifications.add(new Modification(user, "comment latest", "email", new Date(), "10"));
  modifications.add(new Modification(user, "comment latest", "email", new Date(), "9"));
  modifications.add(new Modification(user, "comment latest", "email", new Date(), "8"));
  when(tfsCommand.history(null, 1)).thenReturn(Arrays.asList(modifications.get(0)));
  when(tfsCommand.history("10", 3)).thenReturn(modifications);
  List<Modification> actual = tfsCommand.modificationsSince(workDir, new StringRevision("7"));
  assertThat(actual.containsAll(modifications), is(true));
}
origin: spring-projects/spring-framework

@Override
@SuppressWarnings("unchecked")
public ListBodySpec<E> doesNotContain(E... elements) {
  List<E> expected = Arrays.asList(elements);
  List<E> actual = getResult().getResponseBody();
  String message = "Response body should not have contained " + expected;
  getResult().assertWithDiagnostics(() ->
      AssertionErrors.assertTrue(message, (actual == null || !actual.containsAll(expected))));
  return this;
}
origin: azkaban/azkaban

@Test
public void testEnqueueAll() throws IOException, ExecutorManagerException {
 final QueuedExecutions queue = new QueuedExecutions(5);
 final List<Pair<ExecutionReference, ExecutableFlow>> dataList = getDummyData();
 queue.enqueueAll(dataList);
 Assert.assertTrue(queue.getAllEntries().containsAll(dataList));
 Assert.assertTrue(dataList.containsAll(queue.getAllEntries()));
}
origin: apache/hive

private static void verifyPartitionsPublished(HiveMetaStoreClient client,
  String dbName, String tblName, List<String> partialSpec,
  List<Partition> expectedPartitions) throws TException {
 // Test partition listing with a partial spec
 List<Partition> mpartial = client.listPartitions(dbName, tblName, partialSpec,
   (short) -1);
 assertEquals("Should have returned "+expectedPartitions.size()+
   " partitions, returned " + mpartial.size(),
   expectedPartitions.size(), mpartial.size());
 assertTrue("Not all parts returned", mpartial.containsAll(expectedPartitions));
}
origin: ReactiveX/RxNetty

public void assertMethodsCalled(ClientEvent... events) {
  if (methodsCalled.size() != events.length) {
    throw new AssertionError("Unexpected methods called count. Methods called: " + methodsCalled.size()
                 + ". Expected: " + events.length);
  }
  if (!methodsCalled.containsAll(Arrays.asList(events))) {
    throw new AssertionError("Unexpected methods called count. Methods called: " + methodsCalled
                 + ". Expected: " + Arrays.toString(events));
  }
}
java.utilListcontainsAll

Javadoc

Tests whether this List contains all objects contained in the specified collection.

Popular methods of List

  • add
  • size
    Returns the number of elements in this List.
  • get
    Returns the element at the specified location in this List.
  • isEmpty
    Returns whether this List contains no elements.
  • addAll
  • toArray
    Returns an array containing all elements contained in this List. If the specified array is large eno
  • contains
    Tests whether this List contains the specified object.
  • remove
    Removes the first occurrence of the specified object from this List.
  • iterator
    Returns an iterator on the elements of this List. The elements are iterated in the same order as the
  • clear
  • stream
  • forEach
  • stream,
  • forEach,
  • set,
  • subList,
  • indexOf,
  • equals,
  • hashCode,
  • removeAll,
  • listIterator,
  • sort

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now