### Question:
PrestoThriftRangeValueSet { @ThriftField(1) public List<PrestoThriftRange> getRanges() { return ranges; } @ThriftConstructor  PrestoThriftRangeValueSet(@ThriftField(name = "ranges") List<PrestoThriftRange> ranges); @ThriftField(1) List<PrestoThriftRange> getRanges(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static PrestoThriftRangeValueSet fromSortedRangeSet(SortedRangeSet valueSet);  }### Answer:
@Test public void testFromValueSetAll() { PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.all(BIGINT)); assertNotNull(thriftValueSet.getRangeValueSet()); assertEquals(thriftValueSet.getRangeValueSet().getRanges(), ImmutableList.of( new PrestoThriftRange(new PrestoThriftMarker(null, ABOVE), new PrestoThriftMarker(null, BELOW)))); }
@Test public void testFromValueSetNone() { PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.none(BIGINT)); assertNotNull(thriftValueSet.getRangeValueSet()); assertEquals(thriftValueSet.getRangeValueSet().getRanges(), ImmutableList.of()); }
@Test public void testFromValueSetOf() { PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.of(BIGINT, 1L, 2L, 3L)); assertNotNull(thriftValueSet.getRangeValueSet()); assertEquals(thriftValueSet.getRangeValueSet().getRanges(), ImmutableList.of( new PrestoThriftRange(new PrestoThriftMarker(longValue(1), EXACTLY), new PrestoThriftMarker(longValue(1), EXACTLY)), new PrestoThriftRange(new PrestoThriftMarker(longValue(2), EXACTLY), new PrestoThriftMarker(longValue(2), EXACTLY)), new PrestoThriftRange(new PrestoThriftMarker(longValue(3), EXACTLY), new PrestoThriftMarker(longValue(3), EXACTLY)))); }
@Test public void testFromValueSetOfRangesUnbounded() { PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.ofRanges(Range.greaterThanOrEqual(BIGINT, 0L))); assertNotNull(thriftValueSet.getRangeValueSet()); assertEquals(thriftValueSet.getRangeValueSet().getRanges(), ImmutableList.of( new PrestoThriftRange(new PrestoThriftMarker(longValue(0), EXACTLY), new PrestoThriftMarker(null, BELOW)))); }
@Test public void testFromValueSetOfRangesBounded() { PrestoThriftValueSet thriftValueSet = fromValueSet(ValueSet.ofRanges( range(BIGINT, -10L, true, -1L, false), range(BIGINT, -1L, false, 100L, true))); assertNotNull(thriftValueSet.getRangeValueSet()); assertEquals(thriftValueSet.getRangeValueSet().getRanges(), ImmutableList.of( new PrestoThriftRange(new PrestoThriftMarker(longValue(-10), EXACTLY), new PrestoThriftMarker(longValue(-1), BELOW)), new PrestoThriftRange(new PrestoThriftMarker(longValue(-1), ABOVE), new PrestoThriftMarker(longValue(100), EXACTLY)))); }