use of com.hazelcast.jet.function.DistributedComparator in project hazelcast-jet by hazelcast.
the class DistributedComparatorsTest method nullsFirst_withoutWrapped.
@Test
public void nullsFirst_withoutWrapped() {
DistributedComparator c = nullsFirst(null);
assertEquals(0, c.compare(1, 2));
assertEquals(0, c.compare(2, 1));
assertEquals(1, c.compare(0, null));
assertEquals(-1, c.compare(null, 0));
}
use of com.hazelcast.jet.function.DistributedComparator in project hazelcast-jet by hazelcast.
the class DistributedComparatorsTest method nullsFirstComparator.
@Test
public void nullsFirstComparator() {
DistributedComparator c = nullsFirst(NATURAL_ORDER);
assertEquals(-1, c.compare(1, 2));
assertEquals(1, c.compare(2, 1));
assertEquals(1, c.compare(0, null));
assertEquals(-1, c.compare(null, 0));
}
use of com.hazelcast.jet.function.DistributedComparator in project hazelcast-jet by hazelcast.
the class DistributedComparatorsTest method nullsLast_withoutWrapped.
@Test
public void nullsLast_withoutWrapped() {
DistributedComparator c = nullsLast(null);
assertEquals(0, c.compare(1, 2));
assertEquals(0, c.compare(2, 1));
assertEquals(-1, c.compare(0, null));
assertEquals(1, c.compare(null, 0));
}
use of com.hazelcast.jet.function.DistributedComparator in project hazelcast-jet by hazelcast.
the class DistributedComparatorsTest method nullsLastComparator.
@Test
public void nullsLastComparator() {
DistributedComparator c = nullsLast(NATURAL_ORDER);
assertEquals(-1, c.compare(1, 2));
assertEquals(1, c.compare(2, 1));
assertEquals(-1, c.compare(0, null));
assertEquals(1, c.compare(null, 0));
}
use of com.hazelcast.jet.function.DistributedComparator in project hazelcast-jet by hazelcast.
the class DistributedComparatorsTest method reverseOrderComparator.
@Test
public void reverseOrderComparator() {
DistributedComparator c = REVERSE_ORDER;
assertEquals(1, c.compare(1, 2));
assertEquals(-1, c.compare(2, 1));
}
Aggregations