Merge pull request #536 from apache/add_getNumRetained_to_SortedView

Add getNumRetained to SortedView.