{
QueryHistory history = new QueryHistory();
for (int i = 0; i < 600; i++) {
CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select * from MyTable1 where id=" + i);
history.add(new QueryEntry(query, 4563));
}
assertEquals(500, history.size());
testHistRange(history, 599, 100);
storage.store(userId, history);
}
{
Optional<QueryHistory> history = storage.read(userId, QueryHistory.class);
assertNotNull(history);
assertEquals(500, history.get().size());
testHistRange(history.get(), 599, 100);
for (int i = 0; i < 10; i++) {
CqlQuery query = new CqlQuery(CqlQueryType.SELECT, "select * from MyTable2 where id=" + i);
history.get().add(new QueryEntry(query, 567));
}
storage.store(userId, history.get());
}