MemoryTenantStore extends BaseEntityMemoryStore<Tenant> implements TenantStore { public Tenant findByDefaultHost(String host) { return FluentIterable.from(findAll(0, 0)).filter(withDefaultHost(host)).first().orNull(); }  Tenant findBySlug(String slug); Tenant findByDefaultHost(String host); void updateConfiguration(TenantConfiguration configuration);  }
@Test public void testCreateAndFindByDefaultHost() throws InvalidEntityException, EntityAlreadyExistsException { Tenant tenant1 = new Tenant(); tenant1.setDefaultHost("a-shop.com"); tenant1 = tenantStore.create(tenant1); Tenant tenant2 = new Tenant(); tenant2.setDefaultHost("my-shop.com"); tenant2 = tenantStore.create(tenant2); Assert.assertEquals(tenant2, tenantStore.findByDefaultHost("my-shop.com")); }