Selenium Java: sort numbers in Collection low to high
<pre><code>    driver.get("www.exmpale.com");
    Thread.sleep(7000);
    driver.findElement(By.cssSelector(".side-tab.side-generator")).click();
    driver.manage().window().maximize();
    Thread.sleep(30000);
    // to find the 5 numbers in list1 and list 2 present in the header and
    // add them in the list
    for (int i = 0; i &lt; 7; i++) {

        numberList1
                .add(
                        driver
                        .findElements(By.cssSelector(".generated-line"))
                        .get(0)
                        .findElements(
                                By.cssSelector(".generated-ball.animated.bounceIn&gt;div")                     
                                )

                        .get(i).getText()
                        );
driver.switchTo().frame(driver.findElement(By.id("lotto-frame-games")));

// to find the numbers in the 2 boxes and add them in comparelist1 and
// comparelist2
for (int i = 0; i &lt; 7; i++) {

    compareList1
            .add(driver
                    .findElements(
                            By.cssSelector(".select_num_col_part"))
                    .get(0)
                    .findElements(By.cssSelector(".main_active, .extra_active"))
                    .get(i).getText());


//to sort the lists so that lists can be compared easily.
Collections.sort(numberList1);
Collections.sort(compareList1);
System.out.println(numberList1.toString());
System.out.println(compareList1.toString());
</code></pre>

<p>Result:</p>

<pre><code> [13, 16, 27, 34, 5, 7, 7]
 [13, 16, 27, 34, 5, 7, 7]
</code></pre>

<p>I want that the sort will work from low to high, how can I do it?</p>