Fixing a bug: should use equals() to compare the values of Integer objects.