InfinispanCommunicationDetailsCache implements CommunicationDetailsCache, ServiceLifecycle { @Override public List<CommunicationDetails> getById(String tenantId, String id) { if (id == null) { throw new NullPointerException("Id should not be null!"); } return communicationDetailsMultiConsumers.containsKey(id) ? communicationDetailsMultiConsumers.get(id) : Collections.emptyList(); } InfinispanCommunicationDetailsCache();  InfinispanCommunicationDetailsCache(CacheContainer cacheContainer); @PostConstruct void init(); @Override CommunicationDetails get(String tenantId, String id); @Override void store(String tenantId, List<CommunicationDetails> details); @Override List<CommunicationDetails> getById(String tenantId, String id);  }
@Test public void testGetMultipleEmpty() { List<CommunicationDetails> id = cdc.getById(null, "id"); Assert.assertTrue(id.isEmpty()); }
@Test(expected = NullPointerException.class) public void testGetMultipleNull() { cdc.getById(null, null); }