3 import java
.util
.Arrays
;
4 import java
.util
.HashSet
;
8 public class ColorMemory
implements MessageHandler
{
9 private List
<String
> COLORSTOFIND
= Arrays
.asList(new String
[] { "Blue", "Red", "Yellow" });
10 private Set
<String
> colors
;
13 colors
= new HashSet
<String
>();
17 public void handleMessage(String message
) {
19 LCDPrinter
.print(message
+ " found");
22 public boolean finished() {
23 return colors
.equals(new HashSet
<String
>(COLORSTOFIND
));