ListOptions implements Cloneable { public ListOptions maxResults(int maxKeys) { checkArgument(maxKeys >= 0, "maxKeys must be >= 0"); this.maxKeys = maxKeys; return this; } ListOptions(Integer maxKeys, String marker);  ListOptions(); Integer getMaxResults(); String getMarker(); ListOptions afterMarker(String marker); ListOptions maxResults(int maxKeys); static final ImmutableListOptions NONE; }
@Test public void testMaxResults() { ListContainerOptions options = new ListContainerOptions(); options.maxResults(1000); assertEquals(options.getMaxResults(), Integer.valueOf(1000)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testMaxResultsNegative() { maxResults(-1); }