SpringFive interview question

Write java program for containing duplicate