### Question:
VarBitTimeSeries { public synchronized void append(long timestamp, double value) { if (timestamp < 0 || timestamp > MAX_UNIX_TIMESTAMP) { throw new IllegalArgumentException("Timestamp is not a valid unix timestamp: " + timestamp); } if (size == 0) { appendFirstPoint(timestamp, value); } else { appendNextPoint(timestamp, value); } size++; } VarBitTimeSeries(); synchronized void append(long timestamp, double value); synchronized TimeSeriesIterator read(); Map<String, Double> getStats(); int getSerializedByteSize(); void serialize(ByteBuffer buffer); static TimeSeriesIterator deserialize(final ByteBuffer buffer); static final long MAX_UNIX_TIMESTAMP; static final int BLOCK_HEADER_OFFSET_SECS; static final short DEFAULT_TIMESTAMP_BITSTREAM_SIZE; static final short DEFAULT_VALUE_BITSTREAM_SIZE; }### Answer:
@Test public void testMinTimestamp() { VarBitTimeSeries series = new VarBitTimeSeries(); thrown.expect(IllegalArgumentException.class); series.append(-1, 1); }
@Test public void testMaxTimestamp() { VarBitTimeSeries series = new VarBitTimeSeries(); thrown.expect(IllegalArgumentException.class); series.append(-1, 1); }
@Test(expected = IllegalArgumentException.class) public void testTimestampEncodingOverflow() { VarBitTimeSeries series = new VarBitTimeSeries(); int i = 10; long ts1 = 1477678600L; long ts2 = 14776780L; long ts3 = 1477678580L; series.append(ts1, i); series.append(ts2, i); series.append(ts3, i); }