public void HighestPriorityIndicesForId() { var priorities = new [] { MarsEntityPriority.Normal, MarsEntityPriority.High, MarsEntityPriority.Low, MarsEntityPriority.Normal, MarsEntityPriority.High, MarsEntityPriority.Low, // these 2 won't be included in the set of indices we're searching, so shouldn't appear in the results MarsEntityPriority.High, MarsEntityPriority.Normal }; var indices1 = new HashSet <int> { 0, 1, 2, 3, 4, 5 }; var highestPriorityIndices = FindBestMatchTransform.HighestPriorityIndicesForId(indices1, priorities); Assert.AreEqual(2, highestPriorityIndices.Count); Assert.Contains(1, highestPriorityIndices); Assert.Contains(4, highestPriorityIndices); // what if we don't include the indices that are set to High priority ? var indices2 = new HashSet <int> { 0, 2, 3, 5, 7 }; highestPriorityIndices = FindBestMatchTransform.HighestPriorityIndicesForId(indices2, priorities); Assert.AreEqual(3, highestPriorityIndices.Count); Assert.Contains(0, highestPriorityIndices); Assert.Contains(3, highestPriorityIndices); Assert.Contains(7, highestPriorityIndices); }