BatchedCallback
A callback implementation that can batch notify events dispatched by the SortedList.
This class can be useful if you want to do multiple operations on a SortedList but don't want to dispatch each event one by one, which may result in a performance issue.
For example, if you are going to add multiple items to a SortedList, BatchedCallback call convert individual onInserted(index, 1)
calls into one onInserted(index, N)
if items are added into consecutive indices. This change can help RecyclerView resolve changes much more easily.
If consecutive changes in the SortedList are not suitable for batching, BatchingCallback dispatches them as soon as such case is detected. After your edits on the SortedList is complete, you must always call dispatchLastEvent to flush all changes to the Callback.