java compare two objects in java 8 code example Example: how to compare objects in java this.equals(other)