ShardProgress { public int updateNumberOfShards(int newNumber) { Preconditions.checkArgument(newNumber <= AtlasDbConstants.MAX_SWEEP_QUEUE_SHARDS); return (int) increaseValueFromToAtLeast(SHARD_COUNT_SAS, getNumberOfShards(), newNumber); } ShardProgress(KeyValueService kvs); int getNumberOfShards(); int updateNumberOfShards(int newNumber); long getLastSweptTimestamp(ShardAndStrategy shardAndStrategy); long updateLastSweptTimestamp(ShardAndStrategy shardAndStrategy, long timestamp);  }
@Test public void increasingNumberOfShardsAboveMaxThrows() { assertThatThrownBy(() -> progress.updateNumberOfShards(AtlasDbConstants.MAX_SWEEP_QUEUE_SHARDS + 1)) .isInstanceOf(IllegalArgumentException.class); }