A StringBuilder object will not be equal to a different StringBuilder instance, so the .equals() test will always be false in your program.

You want to compare two Strings contained by the...