/// <summary>
        /// 트랙 목록으로부터 트랙 그룹 hierarchy를 생성한다.
        /// 트랙들은 CreateDate 순서로 정렬되었다고 가정한다.
        /// </summary>
        /// <param name="tracks"></param>
        /// <returns></returns>
        private TrackGroup CreateGroupsFromTracks(ListCollectionView tracks)
        {
            if (tracks.IsEmpty)
                return null;

            IList<TrackGroup> groups = new List<TrackGroup>();
            TrackGroup group = null;

            for (int i = 0, count = tracks.Count; i < count; i++) {
                Track track = (Track)tracks.GetItemAt(i);

                if (group == null || track.CreateDate.Hour != group.Date.Hour) {
                    group = new TrackGroup(track.CreateDate, TrackGroupLevel.Hour);
                    groups.Add(group);
                }

                group.Add(track);
            }

            TrackGroup root = CreateGroupHierarchy(groups);
            return root;
        }