Example usage for com.liferay.portal.kernel.util ArrayUtil reverse

List of usage examples for com.liferay.portal.kernel.util ArrayUtil reverse

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util ArrayUtil reverse.

Prototype

public static <T> void reverse(T[] array) 

Source Link

Usage

From source file:com.liferay.asset.service.test.AssetEntryQueryTest.java

License:Open Source License

@Test
public void testOrderByViewCountsDesc() throws Exception {
    int[] viewCounts = new int[10];
    int[] orderedViewCounts = new int[10];

    for (int i = 0; i < viewCounts.length; i++) {
        int randomInt = RandomTestUtil.randomInt();

        viewCounts[i] = randomInt;/* ww w  . j a  v a  2s  .co m*/
        orderedViewCounts[i] = randomInt;
    }

    Arrays.sort(orderedViewCounts);

    ArrayUtil.reverse(orderedViewCounts);

    testOrderByViewCount(viewCounts, orderedViewCounts, "DESC");
}