Solved Distinct in java