question: private SortedMap < MessageUid , MaildirMessageName > truncateMap ( Map < MessageUid , MaildirMessageName > map , MessageUid from , MessageUid to ) { TreeMap < MessageUid , MaildirMessageName > sortedMap ; if ( map instanceof TreeMap < ? , ? > ) sortedMap = ( TreeMap < MessageUid , MaildirMessageName > ) map ; else sortedMap = new TreeMap < MessageUid , MaildirMessageName > ( map ) ; if ( to != null ) return sortedMap . subMap ( from , to . next ( ) ) ; return sortedMap . tailMap ( from ) ; }
target:  Sorts the given map and returns a subset which is constricted by a lower and an upper limit.