Cos c = null; switch(guessType(key)) { case BY_ID: c = mProv.get(CosBy.id, key); break; case BY_NAME: default: c = mProv.get(CosBy.name, key); break; }
Cos c = mProv.get(guessCosBy(key), key);
    private Cos lookupCos(String key) throws ServiceException {        Cos c = null;        switch(guessType(key)) {        case BY_ID:            c = mProv.get(CosBy.id, key);            break;        case BY_NAME:        default:                        c = mProv.get(CosBy.name, key);            break;        }                if (c == null)            throw AccountServiceException.NO_SUCH_COS(key);        else            return c;    }