Code example for Deque

Methods: peek

0
	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();