GetOptions { public GetOptions ifETagDoesntMatch(String eTag) { checkArgument(getIfMatch() == null, "ifETagMatches() is not compatible with ifETagDoesntMatch()"); checkArgument(getIfUnmodifiedSince() == null, "ifUnmodifiedSince() is not compatible with ifETagDoesntMatch()"); this.ifNoneMatch = checkNotNull(eTag, "eTag"); 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 public void testIfETagDoesntMatch() { GetOptions options = new GetOptions(); options.ifETagDoesntMatch(etag); assertEquals(etag, options.getIfNoneMatch()); }
@Test(expectedExceptions = NullPointerException.class) public void testIfETagDoesntMatchNPE() { ifETagDoesntMatch(null); }