@Test @SneakyThrows public void serializableComparable() { IndexedCollection<EntityHandle<Car>> collection = new ConcurrentIndexedCollection<>(); NavigableIndex index = onAttribute(Car.TIMESTAMP); index.clear(noQueryOptions()); collection.addIndex(index); Car car1 = CarFactory.createCar(1); Car car2 = CarFactory.createCar(2); NTPServerTimeProvider ntpServerTimeProvider = new NTPServerTimeProvider(); ntpServerTimeProvider.startAsync().awaitRunning(); HybridTimestamp ts1 = new HybridTimestamp(ntpServerTimeProvider); HybridTimestamp ts2 = ts1.clone(); Thread.sleep(1000); ts2.update(); assertTrue(ts2.compareTo(ts1) > 0); assertTrue(ts2.getSerializableComparable().compareTo(ts1.getSerializableComparable()) > 0); car1.timestamp(ts1); car2.timestamp(ts2); collection.add(new ResolvedEntityHandle<>(car1)); collection.add(new ResolvedEntityHandle<>(car2)); try (ResultSet<EntityHandle<Car>> resultSet = collection.retrieve(greaterThan(Car.TIMESTAMP, ts1))) { assertEquals(resultSet.size(), 1); assertEquals(resultSet.uniqueResult().get().getModel(), "Taurus"); } index.clear(noQueryOptions()); ntpServerTimeProvider.stopAsync().awaitTerminated(); }