assertEquals(Integer.valueOf(2), sorted.objectAtIndex(0));
assertEquals(Integer.valueOf(1), sorted.objectAtIndex(1));
}
public void testSortedArrayUsingComparatorTimestamp() throws ComparisonException {
NSTimestamp earlierTime = new NSTimestamp();
NSTimestamp laterTime = earlierTime.timestampByAddingGregorianUnits(0, 1, 0, 0, 0, 0);
NSArray<NSTimestamp> array = new NSArray<NSTimestamp>(new NSTimestamp[] { earlierTime, laterTime });
NSArray<NSTimestamp> sorted = array.sortedArrayUsingComparator(NSComparator.AscendingTimestampComparator);
assertEquals(earlierTime, sorted.objectAtIndex(0));
assertEquals(laterTime, sorted.objectAtIndex(1));