public User getUser(String username) throws UserNotFoundException {
        if (username == null) {
            throw new UserNotFoundException("Username cannot be null");
        }
        // Make sure that the username is valid.
        username = username.trim().toLowerCase();
        User user = userCache.get(username);
        if (user == null) {
            synchronized (userBaseMutex.intern(XMPPServer.getInstance().createJID(username, null))) {
                user = userCache.get(username);
                if (user == null) {
                    user = provider.loadUser(username);
                    userCache.put(username, user);
                }
            }
        }
        return user;
    }
@Test
    public void canGetUserByUserNameForExistingUsers()  throws Exception{
    	final User result = userManager.getUser(USER_ID);
    	assertThat(result.getUsername(), is(USER_ID));
        assertThat(result.getEmail(), is("test-email@example.com"));
        assertThat(result.getName(), is("Test User Name"));
    }