Java Collections Competency (Intermediate Level)

  • 24m
  • 24 questions
The Java Collections Competency (Intermediate Level) benchmark evaluates your ability to perform various List operations, recognize the implementations of the Set and Map interfaces, as well as the behavior of classes. A learner who scores high on this benchmark demonstrates that they have the skills to work with List, Set, and Map interfaces and Stream APIs in Java, and perform various operations.

Topics covered

  • analyze the performance characteristics of LinkedHashSets, TreeSets, and HashSets
  • apply terminal operations on predicates
  • assess how to test streams with the .collect function in order to return a collection
  • associate streams containing integer, long, float, and double objects to specific stream types
  • create a TreeMap and use a custom comparator
  • create a TreeSet and sort it using various custom comparators
  • create a TreeSet that stores custom objects without also creating a custom comparator
  • define a custom collector and use it with a stream predicate
  • demonstrate that custom objects can be keys or values in maps, but that in order to ensure that there are no duplicates you have to override the .hashCode and .equals methods of those contained objects correctly
  • demonstrate that predicates can be used to transform one stream object into another
  • describe how different implementations of the Set interface differ in their notions of set order
  • describe how the HashSet behaves with duplicates and how overridden versions of the .equals and the .hashCode methods influence this behavior
  • describe how the overridden version of .equals can be used to control list equality operations
  • describe how to test whether all elements in a stream satisfy a specific condition
  • describe how you can create a custom comparator
  • describe how you can use the .copy function to take values from one list and put them in another
  • describe the LinkedList and Vector implementations of the List interface
  • differentiate between ArrayLists and LinkedLists and the use cases where they are suitable
  • differentiate between methods used to compute set union, difference, intersection, and equality operations
  • recognize how and why EnumSets should be used to represent categorical data
  • recognize how maps work and that they are very similar to their set counterparts
  • recognize that maps are not collections with a series of instanceof checks and a series of comparisons
  • recognize the different types of sets and how they all extend the Set, Collection, and Iterable interfaces
  • recognize what streams are and some of the methods you can invoke on them