public boolean put(V obj) {
    //TODO add your code here
    int size = size();

    try {
        Class vClass = obj.getClass();
        Method method = vClass.getDeclaredMethod("getName");
        method.setAccessible(true);
        cache.put((K) method.invoke(obj), obj);
    } catch (Exception e) {
        return false;
    }
    return size() > size;
}