There are pitfalls to using == in java. It does reference equals for objects. Its safe to use .equals()