JdbcInventory extends JdbcHelper implements Inventory { @Override public boolean contains(ObjectMessage object) { return getCache(object.getStream()).entrySet().stream() .anyMatch(x -> x.getKey().equals(object.getInventoryVector())); } 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 testContains() { ObjectMessage object = getObjectMessage(5, 0, getGetPubkey()); assertFalse(inventory.contains(object)); inventory.storeObject(object); assertTrue(inventory.contains(object)); }