CalendarResource res = null; switch(guessType(key)) { case BY_ID: res = mProv.get(CalendarResourceBy.id, key); break; case BY_EMAIL: res = mProv.get(CalendarResourceBy.name, key); break; case BY_NAME: res = mProv.get(CalendarResourceBy.name, key); break; }
CalendarResource res = mProv.get(guessCalendarResourceBy(key), key);
    private CalendarResource lookupCalendarResource(String key) throws ServiceException {        CalendarResource res = null;        switch(guessType(key)) {        case BY_ID:            res = mProv.get(CalendarResourceBy.id, key);            break;        case BY_EMAIL:            res = mProv.get(CalendarResourceBy.name, key);            break;        case BY_NAME:            res = mProv.get(CalendarResourceBy.name, key);                        break;        }        if (res == null)            throw AccountServiceException.NO_SUCH_CALENDAR_RESOURCE(key);        else            return res;    }