if (identification instanceof Login) {
if (identification.isLogin()) {
    public static Login readLoginByUsername(String username) {        // Temporary solution until DML provides indexed relations.        final String lowerCaseUsername = username.toLowerCase();        final SoftReference<Login> loginReference = loginMap.get(lowerCaseUsername);        if (loginReference != null) {            final Login login = loginReference.get();            if (login != null && login.getRootDomainObject() == RootDomainObject.getInstance()                    && login.getUsername().equalsIgnoreCase(lowerCaseUsername)) {                return login;            } else {                loginMap.remove(lowerCaseUsername);            }        }        // *** end of hack        for (final Identification identification : RootDomainObject.getInstance().getIdentifications()) {            if (identification instanceof Login) {                final Login login = (Login) identification;                // Temporary solution until DML provides indexed relations.                loginMap.put(login.getUsername().toLowerCase(), new SoftReference<Login>(login));                // *** end of hack                if (login.getUsername().equalsIgnoreCase(username)) {                    return login;                }            }        }        return null;    }