Remove Duplicate Item name in arraylist : Please help me. I want to show the username only once from firebase. Although the user have multiple record in the firebase. I just want to view the name of user who make order. The user can make multiple order, but I just want to show their name once.

I try many ways but I cant success. Someone who know about this. Thank you very much.

[This is my firebase][1]

[This is the result I get][2]

   

     public void onCreate(Bundle savedInstanceState) {
    
    
            UID = this.getArguments().getString("UID");
    
    
            mDatabase = FirebaseDatabase.getInstance().getReference();
            mStorage = FirebaseStorage.getInstance();
    
            mItems = new ArrayList<>();
            wordDulicate = new ArrayList<>();
            tempList = new ArrayList<>();
    
            if(UID != null){
                mItemsKey = new ArrayList<>();
                mOrderedItemRef = mDatabase.child("OrderedItem");
                Log.d(TAG, " mOrderedItemRef:" + mOrderedItemRef);
                mOrderedItemVEL =  mOrderedItemRef.addValueEventListener(new ValueEventListener() {
                    @Override
                    public void onDataChange(DataSnapshot dataSnapshot) {
                        mItems.clear();
                        mItemsKey.clear();
                        wordDulicate.clear();
                        Log.d(TAG, "onDataChange");
                        for (DataSnapshot d : dataSnapshot.getChildren()) {
                            OrderedItem orderedItem = d.getValue(OrderedItem.class);
                            Log.d(TAG, "orderedItem:" + orderedItem.getUserName());
                            mItems.add(orderedItem);
                            mItemsKey.add(d.getKey());
                        }
                        updateUI();
    
                    }
    
                    @Override
                    public void onCancelled (DatabaseError databaseError){
                        Log.d(TAG, "get item databaseError: "+databaseError);
                    }
                });
            }
            else{
                Log.d(TAG, "UID: "+UID);
    
            }
            super.onCreate(savedInstanceState);
        }
    
        @Override
        public void onDestroy(){
            super.onDestroy();
            //   if (mItemRef != null) mItemRef.removeEventListener(mItemVEL);
        }
    
        @Override
        public void onDetach(){
            super.onDetach();
            //  if (mItemRef != null) mItemRef.removeEventListener(mItemVEL);
        }
    
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState) {
            View view = inflater.inflate(R.layout.fragment_admin_list_user_order, container, false);
            mItemRecyclerView = (RecyclerView) view.findViewById(R.id.admin_order_recycler_view);
            DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mItemRecyclerView.getContext(), new LinearLayoutManager(getActivity()).getOrientation());
            mItemRecyclerView.addItemDecoration(dividerItemDecoration);
            mItemRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
            return view;
        }
    
        private void updateUI(){
            Log.d(TAG, "Enter updateUI(); mItems: " + mItems);
            mAdapter = new ItemAdapter(mItems);
            mItemRecyclerView.setAdapter(mAdapter);
        }
    
        private class ItemHolder extends RecyclerView.ViewHolder{
            OrderedItem mItems;
            TextView mNameTextView;
    
            ItemHolder(final View itemView){
                super(itemView);
                mNameTextView = (TextView) itemView.findViewById(R.id.textview_username);
    
    
              /*  if (UID != null) {
                    itemView.setOnClickListener(new View.OnClickListener() {
                        @SuppressLint("LongLogTag")
                        @Override
                        public void onClick(View view) {
                            Log.d(TAG, "UID != null");
                            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    
                            builder
                                    .setMessage("Delete This Item?")
                                    .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
                                        public void onClick(DialogInterface dialog, int id) {
                                            deleteItem(mItems);
                                        }
                                    }).setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog, int id) {
                                    // User cancelled the dialog
                                }
                            });
    
                            AlertDialog dialog = builder.create();
                            dialog.show();
                        }
                    });
                }*/
            }
    
            void bindData(OrderedItem s){
               mItems = s;
               mNameTextView.setText(s.getUserName());
    
    
    
            }
        }
    
        private class ItemAdapter extends RecyclerView.Adapter<ItemHolder>{
            private ArrayList<OrderedItem> mItems;
    
            ItemAdapter(ArrayList<OrderedItem> Items){
                mItems = Items;
            }
    
            @Override
            public ItemHolder onCreateViewHolder(ViewGroup parent, int viewType) {
                LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
                View view = layoutInflater.inflate(R.layout.admin_listed_user_order,parent,false);
                return new ItemHolder(view);
            }
    
            @Override
            public void onBindViewHolder(ItemHolder holder, int position) {
                OrderedItem s = mItems.get(position);
                holder.bindData(s);
            }
    
            @Override
            public int getItemCount() {
                return mItems.size();
            }
    
        }
    
    }



  [1]: https://i.stack.imgur.com/hbHor.png
  [2]: https://i.stack.imgur.com/4Tt7n.png