Account a = null; switch(guessType(key)) { case BY_ID: a = mProv.get(AccountBy.id, key); break; case BY_EMAIL: a = mProv.get(AccountBy.name, key); break; case BY_NAME: a = mProv.get(AccountBy.name, key); break; }
Account a = mProv.get(guessAccountBy(key), key);
    private Account lookupAccount(String key) throws ServiceException {        Account a = null;        switch(guessType(key)) {        case BY_ID:            a = mProv.get(AccountBy.id, key);            break;        case BY_EMAIL:            a = mProv.get(AccountBy.name, key);            break;        case BY_NAME:            a = mProv.get(AccountBy.name, key);                        break;        }        if (a == null)            throw AccountServiceException.NO_SUCH_ACCOUNT(key);        else            return a;    }