UserStorage { public boolean add(User user){ boolean result = false; if (user != null) { this.storage.put(user.getId(), user); result = true; } return result; } UserStorage();  UserStorage(final Map<String, User> storage); boolean add(User user); boolean update(User user); boolean delete(String key); User read(String key); boolean transfer(int value,User userFrom,User userTo);  }
@Test public void whenAddUserToStorageThatContainsIt() throws Exception { User userFirst = new User("Sergey"); UserStorage myStorage = new UserStorage(); boolean result = myStorage.add(userFirst); Assert.assertThat(result,is(true)); }