/**
 * @file ListDemo.java
 * @author Valery Samovich
 * @version 1
 * @date 2015/01/20
 */

package com.samovich.java.basics.collections.list;

import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import java.util.Objects;

public class ListDemo {

    public static void main(String[] args) {
        
        List listA = new ArrayList();
        
        listA.add("element 0");
        listA.add("element 1");
        listA.add("element 2");
        
        // access via index
        Object element0 = listA.get(0);
        Object element1 = listA.get(1);
        Object element2 = listA.get(2);
        
        // access via Iterator
        Iterator iterator = listA.iterator();
        while(iterator.hasNext()) {
            String element = (String) iterator.next();
            System.out.println(element);
        }
        
        // access via for loop
        for(Object object : listA) {
            String element = (String) object;
            System.out.println(element);
        }
        
    }
}

@@ -159,35 +159,13 @@
 til.
-Iterator;%0Aimport java.util.
+Array
 List
@@ -179,33 +179,32 @@
 t java.util.
-ArrayList
+Iterator
 ;%0Aimport jav
@@ -214,15 +214,12 @@
 til.
-Objects
+List
 ;%0A%0Ap
@@ -476,38 +476,38 @@
 a index%0A        
-Object
+String
  element0 = list
@@ -501,16 +501,25 @@
 ement0 =
+ (String)
  listA.g
@@ -525,38 +525,38 @@
 get(0);%0A        
-Object
+String
  element1 = list
@@ -550,16 +550,25 @@
 ement1 =
+ (String)
  listA.g
@@ -582,22 +582,22 @@
         
-Object
+String
  element
@@ -599,16 +599,25 @@
 ement2 =
+ (String)
  listA.g

Fix broken class