Don't use == to test String equality. Use the equals() method instead. The first tests whether they are the same instance, the second tests whether they are semantically equivalent.