GetOptions extends BaseHttpRequestOptions { public GetOptions tail(long count) { checkArgument(count > 0, "count must be > 0"); ranges.add(String.format("-%d", count)); return this; }  @Override Multimap<String, String> buildRequestHeaders(); GetOptions range(long start, long end); GetOptions startAt(long start); GetOptions tail(long count); String getRange(); GetOptions ifModifiedSince(Date ifModifiedSince); String getIfModifiedSince(); GetOptions ifUnmodifiedSince(Date ifUnmodifiedSince); String 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 public void testTail() { GetOptions options = new GetOptions(); options.tail(100); assertEquals(options.getRange(), "bytes=-100"); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testTailFail() { GetOptions options = new GetOptions(); options.tail(0); }