Capgemini interview question

Print duplicate elements in an arraylist?