private void assertUser(User user) {
   assertNotNull(user);
   assertEquals(1, user.getId());
   assertEquals("Tom", user.getName());
   assertEquals("Cat", user.getSurname());
   assertEquals(User.Gender.MALE, user.getGender());
   assertNotNull(user.getAccountIds());
   assertEquals(1, user.getAccountIds().size());
   assertTrue(user.getAccountIds().contains(12));
   assertNotNull(user.getAddresses());
   assertEquals(1, user.getAddresses().size());
   assertEquals("Dark Alley", user.getAddresses().get(0).getStreet());
   assertEquals("1234", user.getAddresses().get(0).getPostCode());
 }
  public void testEventFilter() throws Exception {
    User user1 = new UserPB();
    user1.setId(1);
    user1.setName("John");
    user1.setSurname("Doe");
    user1.setGender(User.Gender.MALE);
    user1.setAge(22);

    NoopEventListener listener = new NoopEventListener();
    remoteCache.addClientListener(listener);

    expectElementsInQueue(listener.createEvents, 0);

    remoteCache.put("user_" + user1.getId(), user1);

    assertEquals(1, remoteCache.size());
    expectElementsInQueue(listener.createEvents, 1);

    remoteCache.removeClientListener(listener);
  }