SpringFive Interview Question

Write java program for containing duplicate