Question: / / color . java package question 5 ; public enum Color { Red, Green, Blue, Purple, Yellow, Teal, Aqua } / / unique tester.java
colorjava
package question;
public enum Color
Red,
Green,
Blue,
Purple,
Yellow,
Teal,
Aqua
unique tester.java
package question;
import java.util.List;
import java.util.Map;
public class UniqueTester
record ComboString symbol, Color color
public static Integer countUniqueCombinationsList data
return null;
questionjava
package question;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.testng.Assert;
import org.testng.annotations.Test;
You are writing a utility that helps identify unique Groupings
Groups are combos of Strings colors
When given multiple maps of these groupings, count how many total unique combos are found
public class Question
@Test
public void test
List dataSet new ArrayList;
var map new HashMap;
mapputA Color.Teal;
mapputB Color.Red;
var map new HashMap;
mapputA Color.Teal;
mapput Color.Blue;
dataSet.addmap;
dataSet.addmap;
Assert.assertEqualsintUniqueTestercountUniqueCombinationsdataSet;
@Test
public void test
List dataSet new ArrayList;
var map new HashMap;
mapputA Color.Blue;
mapputB Color.Green;
var map new HashMap;
mapputA Color.Red; just for test, A can't be an
mapputC Color.Yellow;
dataSet.addmap;
dataSet.addmap;
Assert.assertEqualsintUniqueTestercountUniqueCombinationsdataSet;
@Test
public void test
List dataSet new ArrayList;
var map new HashMap;
mapputA Color.Blue;
mapputB Color.Green;
var map new HashMap;
mapputC Color.Red; just for test, A can't be an
mapputD Color.Yellow;
var map new HashMap;
mapputE Color.Teal; just for test, A can't be an
mapputA Color.Green;
dataSet.addmap;
dataSet.addmap;
dataSet.addmap;
Assert.assertEqualsintUniqueTestercountUniqueCombinationsdataSet;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
