Code example for Stack

Methods: isEmpty, peek

0
			sleeper.sleep();
		} 
		if(waitForActivity){
			waitForActivityIfNotAvailable(); 
		} 
		if(!activityStack.isEmpty()){
			activity=activityStack.peek().get();
		} 
		return activity;
	} 
 
	/** 
	 * Returns to the given {@link Activity}. 
	 * 
	 * @param name the name of the {@code Activity} to return to, e.g. {@code "MyActivity"} 
	 */ 
 
	public void goBackToActivity(String name)
	{ 
		ArrayList<Activity> activitiesOpened = getAllOpenedActivities();
		boolean found = false;