aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/test/java/com/yahoo/collections/ComparablesTest.java
blob: cdaead85d5513eaba772810d867a2068f2fda886 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

package com.yahoo.collections;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class ComparablesTest {
    @Test
    public void testMinAndMax() {
        Integer i1 = 1;
        Integer i2 = 2;

        assertEquals(i1, Comparables.min(i1, i2));
        assertEquals(i1, Comparables.min(i2, i1));

        assertEquals(i2, Comparables.max(i1, i2));
        assertEquals(i2, Comparables.max(i2, i1));
    }
}