How to remove duplicate number entry in Android when fetching contact number from contact book?

**For example:** 
In contact book for
 one name multiple contact.. ex-type-home-9428060123,  

 type-work-9428060123, I want to fetch unique contact number from all 
 type,android problematically? I use below code for fetching  

 information:

```
private void getContactsDetails() {
 showLoader();
           String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '"
                   + ("1") + "'";
           Cursor phones = getActivity().getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
    null, null/*selection + " AND " +   
    ContactsContract.Contacts.HAS_PHONE_NUMBER + "=1"*/, null, "UPPER("
    +    ContactsContract.Contacts.DISPLAY_NAME + ") ASC");
           ContactString = new ArrayList<>();

           if (phones != null) {

               if (phones.getCount() > 0) {
                   tvNoContact.setVisibility(View.GONE);

                   while (phones.moveToNext()) {
                       String Name = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
                       String number = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
                  HashSet<String> mobileNoSet = new HashSet<String>();
                if (!mobileNoSet.contains(number)){
                       String s = number.replaceAll("\\W", "");
                       String lastTenCharContact = null;
                       if (s != null && s.length() > 10) {
                           lastTenCharContact = s.substring(s.length() - 10);
                       } else {
                           lastTenCharContact = s;
                       }
                       // String substring = s.substring(Math.max(s.length() - 10, 0));
                       Log.d(TAG, "getContactsDetails: " + lastTenCharContact);
                       String image_uri = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.PHOTO_URI));
                       ContactString.add(lastTenCharContact);

                       DeviceContact contactModel = new DeviceContact(Name.toUpperCase(), lastTenCharContact, image_uri);

                       contactModelsList.add(contactModel);
                         mobileNoSet.add(number);

                       Log.d(TAG, "Name : " + Name + ", Number : " + number + ", Photo : " + image_uri);}
                   }
                   hideLoader();
                   AllContactsyncapiCall();

               } else {
                   tvNoContact.setVisibility(View.VISIBLE);
               }
           }    }

```