Java Test Automation / Quiz

Choose the Test Data Container

Match ordered cases, unique values, and keyed records to Java collection behavior in concrete test-data code.

Difficulty
Easy
Format
Quiz
Points
100
Estimate
6 min

// MISSION BRIEF

Your Mission

Test data has shape: sometimes sequence matters, sometimes duplicates are the bug, and sometimes a stable key is how a case is found. Read the Java snippets and choose the collection whose semantics match the assertion.

// FIRST CONTACT

Battle teaser

A parameterized test must execute these rows in this exact order, including both duplicate values: ["guest", "member", "guest"] Which declaration matches that requirement?

  1. ASet<String> roles = new HashSet<>(List.of("guest", "member", "guest"));
  2. BOptional<String> roles = Optional.of("guest");
  3. CList<String> roles = new ArrayList<>(List.of("guest", "member", "guest"));
  4. DMap<String, String> roles = Map.of("guest", "member");
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

java-collectionstest-datalist-set-mapjava-testing