Q:

How to check for an amount of a certain data type in list?

I am writing an UnoPlayer.java code for a main method that has already been written out in order to test the legality of our UnoPlayer method. 
I am trying to check to see if the amount of one color (a data type) in my hand is greater than the amount of the other colors.
hand is a list type!!
So, for Color.BLUE, I have this:
if (hand.contains(Color.BLUE > Color.RED && Color.GREEN && Color.YELLOW)) {
    colorReturned = Color.BLUE;
}

I know that this does not work because my Color data type does not work with binary operands because they are not ints. How would I code it so that it says
//if (hand contains more Color.BLUE than the rest of the colors) {
//returns Color.BLUE }
here is the card implementation:
private UnoPlayer.Color color;
private UnoPlayer.Rank rank;
private int number;

public Card(UnoPlayer.Color color, UnoPlayer.Rank rank) {
    this.color = color;
    this.rank = rank;
    this.number = -1;
}

public Card(UnoPlayer.Color color, int number) {
    this.color = color;
    this.rank = UnoPlayer.Rank.NUMBER;
    this.number = number;
}

public Card(UnoPlayer.Color color, UnoPlayer.Rank rank, int number) {
    this.color = color;
    this.rank = rank;
    this.number = number;
}

A:

The problem is that you're not using contains correctly, according to Java docs, the method contains returns a boolean variable (true or false depending on whether a value exists in the list). However you're inputting a boolean expression, when contains takes an Object as a parameter.
My suggestion to checking if a certain data type occurs the most in a list, I would first sort the list, then keep count of the highest occurring data type like so,
Collections.sort(hand);
int prev = hand.get(0);
int occursMost = hand.get(0);
int count = 1;
int maxCount = 1;

for (int i = 1; i < hand.length; i++) {
    if (a.get(i) == prev)
        count++;
    else {
        if (count > maxCount) {
            popular = a.get(i-1);
            maxCount = count;
        }
        prev = hand.get(i);
        count = 1;
    }
}
if(occursMost == Color.BLUE) {
    colorReturned = Color.BLUE;
}

A little bit how this works, so let's say your hand looks like this
GREEN, BLUE, RED, GREEN, BLUE, BLUE

I'm not quite sure about the int values behind the colors but after sorting, the hand could looks like this,
GREEN, GREEN, RED, BLUE, BLUE, BLUE

The loop will start at green, then keep incrementing count until a different color is found. Once a different color is found, count is checked with maxCount to see if the most popular color so far has been found. Then it resets count and starts counting the occurrences of the next color in the list. At the end of the loop, the most popular color in the list should be set.

