Code example for LinkedList

Methods: add, get

0
		cm.publish(taintedElement);
	} 
 
	public void linkedListConcreteWriteReadTest() { 
		String tainted = TelephonyManager.getDeviceId();
		LinkedList<String> list = new LinkedList<String>();
		list.add(tainted);
		// because whole list is tainted, even untainted elements are tainted if they are fetched from the list 
		String taintedElement2 = list.get(0);
 
		ConnectionManager cm = new ConnectionManager();
		cm.publish(taintedElement2);
	} 
 
	public void linkedListConcreteWriteReadNegativeTest() { 
		String tainted = TelephonyManager.getDeviceId();
		LinkedList<String> notRelevantList = new LinkedList<String>();
		LinkedList<String> list = new LinkedList<String>();
		list.add("neutral");
		notRelevantList.add(tainted);
		String taintedElement = notRelevantList.get(0);