|
@@ -103,4 +103,17 @@ public class MyArrayListTest {
|
103
|
103
|
String expectedString = "they moved the table";
|
104
|
104
|
Assert.assertFalse(stringList.contains(expectedString));
|
105
|
105
|
}
|
|
106
|
+
|
|
107
|
+ @Test
|
|
108
|
+ public void testIndexOf() {
|
|
109
|
+ String findMe = "Nhu got more tears to fill up her tea";
|
|
110
|
+ stringList.add("Wilhelm spilled the tea");
|
|
111
|
+ stringList.add("the table got wet :(");
|
|
112
|
+ stringList.add("Nhu got more tears to fill up her tea");
|
|
113
|
+ stringList.add("Wilhelm spilled the tea");
|
|
114
|
+
|
|
115
|
+ int expectedIndex = 3;
|
|
116
|
+
|
|
117
|
+ Assert.assertEquals(expectedIndex, stringList.indexOf(findMe));
|
|
118
|
+ }
|
106
|
119
|
}
|