### Question:
RList extends RCollection { public void addAllMayTTL(String key, List<byte[]> vs, int ttl) throws KitDBException { DAssert.isTrue(ttl > 0, ErrorType.PARAM_ERROR, "ttl must greater than 0"); addAllMayTTLPrivate(key, vs, ttl); } protected  RList(DB db); void add(String key, byte[] v); void addAll(String key, List<byte[]> vs); void addAllMayTTL(String key, List<byte[]> vs, int ttl); void set(String key, long i, byte[] v); byte[] get(String key, long i); List<byte[]> get(String key, List<Long> is); Long left(String key); Long right(String key); int size(String key); void deleteFast(String key); void delete(String key); boolean isExist(String key); List<byte[]> range(String key, long start, long end); @Override @SuppressWarnings("unchecked") RIterator<RList> iterator(String key); Entry getEntry(RocksIterator iterator); List<byte[]> blpop(String key, int num); List<byte[]> brpop(String key, int num); @Override KeyIterator getKeyIterator(); void ttl(String key, int ttl); void delTtl(String key); int getTtl(String key); void addMayTTL(String key, byte[] v, int ttl); final static String HEAD; final static byte[] HEAD_VALUE_B; final static byte[] HEAD_B; }### Answer:
@Test public void addAllMayTTL() throws Exception { String head = "addAllMayTTL0"; RList list = db.getList(); int num = 10; List<byte[]> integers = new ArrayList<>(); for (int i = 0; i < num; i++) { integers.add(("hello" + i).getBytes()); } List<List<byte[]>> integers_splits = CollUtil.split(integers, 3000); try { for (List<byte[]> integers_split : integers_splits) { list.addAllMayTTL(head, integers_split, 5); } Assert.assertEquals(num, list.size(head)); for (int i = 0; i < num; i++) { byte[] bytes = list.get(head, i); Assert.assertEquals(new String(bytes), ("hello" + i)); } Thread.sleep(5000); Assert.assertEquals(0, list.size(head)); for (int i = 0; i < num; i++) { byte[] bytes = list.get(head, i); Assert.assertNull(bytes); } } finally { } }