JdbcInventory extends JdbcHelper implements Inventory { @Override public List<InventoryVector> getInventory(long... streams) { List<InventoryVector> result = new LinkedList<>(); for (long stream : streams) { getCache(stream).entrySet().stream() .filter(e -> e.getValue() > now()) .forEach(e -> result.add(e.getKey())); } return result; } JdbcInventory(JdbcConfig config); @Override List<InventoryVector> getInventory(long... streams); @Override List<InventoryVector> getMissing(List<InventoryVector> offer, long... streams); @Override ObjectMessage getObject(InventoryVector vector); @Override List<ObjectMessage> getObjects(long stream, long version, ObjectType... types); @Override void storeObject(ObjectMessage object); @Override boolean contains(ObjectMessage object); @Override void cleanup();  }
@Test public void testGetInventory() throws Exception { List<InventoryVector> inventoryVectors = inventory.getInventory(1); assertEquals(1, inventoryVectors.size()); inventoryVectors = inventory.getInventory(2); assertEquals(1, inventoryVectors.size()); }