RedisDBHandler implements IDBHandler { @Override public String store(byte[] value) { if (value == null) { return null; } String uuid = UUID.randomUUID().toString(); String key = put(uuid, 1, value); return key; } RedisDBHandler(); synchronized Jedis getJedisConnection(); @Override String getDatabaseVendor(); byte[] serialize(Object obj); Object deserialize(byte[] bytes); @Override boolean hasKey(String key); @Override String put(String key, int sequenceId, byte[] value); @Override Map<Integer, byte[]> get(String key); @Override List<Integer> getSequenceIds(String key); @Override boolean update(String key, int sequenceId, byte[] value); @Override String store(byte[] value); @Override Map<Integer, byte[]> remove(String key);  }
@Test public void testStore() { byte[] serializedValue = "foo".getBytes(); String key = dbHandler.store(serializedValue); assertNotNull(key); key = dbHandler.store(null); assertNull(key); }