import org.testng.annotations.Test;
public class SortedRangeSetTest {
@Test(groups = { UNIT })
public void manipulateSimpleRanges() {
Range r1 = new Range("5");
assert r1.getLow() == 5 : "Lowest value should be 5";
assert r1.getHigh() == 5 : "Highest value should be 5";
assert r1.contains(5) : "Range should contain 5";
assert !r1.contains(4) : "Range should not contain 4";
assert !r1.contains(6) : "Range should not contain 6";
assert "5".equals(r1.toRepresentation()) : "Representation should be 5";
Range r2 = new Range("2-6");
assert r2.getLow() == 2 : "Lowest value should be 2";
assert r2.getHigh() == 6 : "Highest value should be 6";
assert r2.contains(6) : "Range should contain 6";
assert !r2.contains(7) : "Range should not contain 7";
assert !r2.contains(0) : "Range should not contain 0";
assert "2-6".equals(r2.toRepresentation()) : "Representation should be 2-6";
Range r3 = new Range(5);
assert r3.getLow() == 5 : "Lowest value should be 5";
assert r3.getHigh() == 5 : "Highest value should be 5";
Range r4 = new Range(6,8);
assert r4.getLow() == 6 : "Lowest value should be 6";
assert r4.getHigh() == 8 : "Highest value should be 8";
Range r5 = new Range(5);
r5.setLow(8);
assert r5.getHigh() == 8 : "Highest value should be 8";
r5.setHigh(2);
assert r5.getLow() == 2 : "Lowest value should be 2";
}