You should never use == for comparing objects in Java, especially value object e.g. String, Order or Employee. Instead implement equals() and hashcode() and use them to check if two objects are equal or not.