You are comparing references and not values. Either do:
value1.equals(value2);
or do:
value1.doubleValue() == value2.doubleValue();
Read more about Autoboxing here to figure out why this works sometimes (with integers) and why sometimes it does not. Notice that all integers are a summation of a power of 2: 6 = 2 + 4, whereas decimals are not: 6.2 = 4 + 2 + 1/8 + ...