### Question:
StringStack implements Iterable<String> { public int indexOf(String o) { int i = 0; for (String x: this) { if (x.equals(o)) return i; else i++; } return -1; } StringStack(String... xs);  StringStack(Iterable<String> xs); int size(); boolean isEmpty(); boolean contains(String o); boolean add(String e); void clear(); String get(int index); int indexOf(String o); Iterator<String> iterator();  }### Answer:
@Test public void testIndexOf() { StringStack ss = new StringStack("moo", "far"); assertEquals(0, ss.indexOf("moo")); assertEquals(1, ss.indexOf("far")); assertEquals(-1, ss.indexOf("erk")); assertEquals(-1, ss.indexOf(null)); }