ArrayList<T> list = (ArrayList<T>)stack.get(); if (list == null) { return null; } return list.get(list.size() - 1);
return stack.get();
ArrayList<T> list = stack.get(); if (list == null) { return null; } T rtn = list.remove(list.size() - 1); if (list.size() == 0) { stack.set(null); list.clear(); } return rtn;
ArrayList<T> list = stack.get(); if (list == null) { list = new ArrayList<T>(1); stack.set(list); } list.add(obj);