That's one of the quirky ways java optimizes strings. Instead of creating multiple constant strings, sometimes the Java compiler will recognize that it already has that object and just assigns the same reference:
String s1 = "Test";
String s2 = "Test";
if (s1 == s2)
{
System.out.println("s1 and s2 have the same reference!");
}
However, you can explicitly tell Java to create a new variable (and actually, the code above will fail sometimes because that optimization isn't used all the time)
String s1 = new String("Test");
String s2 = new String("Test");
if (s1 != s2)
{
System.out.println("s1 and s2 have different references");
}