if (authenticator == null) { authenticator = (Authenticator) resolve(Authenticator.ROLE);  }
    public void authenticate(User user, String password)        throws PasswordMismatchException, UnknownEntityException, DataBackendException    {        if (authenticator == null)        {            authenticator = (Authenticator) resolve(Authenticator.ROLE);        }        if (!authenticator.authenticate(user, password))        {            throw new PasswordMismatchException("Can not authenticate user.");        }    }