An adapter manages the data model and adapts it to each row in RecyclerView or ListView. The adapter handles the filtering and sorting: