you should not be comparing strings, but actually using Term.equals.