Code example for Deque

Methods: isEmpty, pop, toString

0
        } 
        return instance;
    } 
	 
	public boolean isEmpty() { 
		return commandHistory.isEmpty();
	} 
 
	public Command peek() { 
		return commandHistory.peek();
	} 
 
	public void clear() { 
		commandHistory.clear();
	} 
 
	public void push(Command e) {
		commandHistory.push(e);
		System.out.println(commandHistory.toString());
	} 
 
	public Command pop() { 
		if (!isEmpty()){ 
			System.out.println(commandHistory.toString());
			return commandHistory.pop();
		} 
		else return null; 
	} 
 
	public int size() {