Code example for LinkedList

Methods: isEmpty, removeLast

0
    public void push(Principal principal, Object credential, Subject subject) {
        stack.add(new Entry(principal, credential, subject));
    } 
 
    public Entry pop() { 
        if (stack.isEmpty()) {
            return null; 
        } 
        return stack.removeLast();
    } 
 
    public Entry peek() { 
        if (stack.isEmpty()) {
            return null; 
        } 
        return stack.getLast();
    } 
 
    public boolean isEmpty() { 
        return stack.isEmpty();
    }