Java Compare Two Objects In Typescript Interview