122123124125126127128129130131132
Object key = "key"; Object value = "value"; cache.put(key, value); cache.clear(); return cache.get(key)==null ? true : false; } /**
372373374375376377378379380381382
for (; i <10; i++) { cache.put(new Integer(i), new Long[2048*2048]); } } catch (OutOfMemoryError o){ //int size = cache.size(); cache.clear(); return true; //return size==i; } return false; }
394395396397398399400401402403404
try { for (; i <10; i++) { cache.put(new Integer(i), new Long[2048*2048]); } } catch (OutOfMemoryError o){ cache.clear(); return false; } return cache.size()==i; }