GetOptions { public GetOptions range(long start, long end) { checkArgument(start >= 0, "start must be >= 0"); checkArgument(end >= 0, "end must be >= 0"); getRanges().add(String.format("%d-%d", start, end)); return this; }  GetOptions range(long start, long end); GetOptions startAt(long start); GetOptions tail(long length); GetOptions ifModifiedSince(Date ifModifiedSince); Date getIfModifiedSince(); GetOptions ifUnmodifiedSince(Date ifUnmodifiedSince); Date getIfUnmodifiedSince(); GetOptions ifETagMatches(String eTag); String getIfMatch(); GetOptions ifETagDoesntMatch(String eTag); String getIfNoneMatch(); List<String> getRanges(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static final GetOptions NONE; }
@Test(expectedExceptions = IllegalArgumentException.class) public void testRangeNegative1() { range(-1, 0); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testRangeNegative2() { range(0, -1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testRangeNegative() { range(-1, -1); }
@Test public void testRange() { GetOptions options = new GetOptions(); options.range(0, 1024); bytes1to1024(options); }
@Test public void testRangeStatic() { GetOptions options = range(0, 1024); bytes1to1024(options); }