DistributedCache implements Cache { @Override public boolean has(String key) { return null != key && distributedMap.containsKey(key); } DistributedCache(HazelcastConnection hazelcastConnection, String name, ObjectMapper mapper); static void setupConfig(HazelcastConnection hazelcastConnection); @Override ActionResponse put(String key, ActionResponse data); @Override ActionResponse get(String key); @Override boolean has(String key);  }
@Test public void testHas() throws Exception { GroupResponse baseRequest = new GroupResponse(); baseRequest.setResult(Collections.<String, Object>singletonMap("Hello", "World")); distributedCache.put("DUMMY_KEY_HAS", baseRequest); boolean response = distributedCache.has("DUMMY_KEY_HAS"); assertTrue(response); response = distributedCache.has("INVALID_KEY"); assertFalse(response); response = distributedCache.has(null); assertFalse(response); }