class Str2 {
	public static void main (String args[]) {
		String a = "1";
		a += "2";
		System.out.println(a);
		System.out.println("abc".indexOf("", -99999999));
		System.out.println("abc".indexOf("", 99999999));
		System.out.println("".indexOf("a"));
		System.out.println("".indexOf(""));
		System.out.println("abc".lastIndexOf("", -99999999));
		System.out.println("abc".lastIndexOf("", 99999999));
		System.out.println("".lastIndexOf("a"));
		System.out.println("".lastIndexOf(""));
	}
}

/* Expected Output:
12
0
-1
-1
0
-1
3
-1
0
*/

@@ -484,55 +484,839 @@
 ));%0A
-%09%7D%0A%7D%0A%0A/* Expected Output:%0A12%0A0%0A-1%0A-1%0A0%0A-1%0A3%0A-1%0A
+%0A%09%09substring();%0A%09%7D%0A%0A%09/** Substring match.%0A%09 *  @author Peter Graves %3Cpeter@armedbear.org%3E%0A%09 */%0A%09public static void substring() %7B%0A%09%09String s1 = %22this is a test yes it is%22;%0A%09%09String s2 = %22yet another test%22;%0A%09%09String s3 = s2.substring(12); // %22test%22%0A%09%09for (int i = 0; i %3C s1.length(); i++)%0A%09%09%09System.out.println(%22i = %22 + i + %22 index = %22 + s1.lastIndexOf(s3, i));%0A%09%7D%0A%09%0A%7D%0A%0A/* Expected Output:%0A12%0A0%0A-1%0A-1%0A0%0A-1%0A3%0A-1%0A0%0Ai = 0 index = -1%0Ai = 1 index = -1%0Ai = 2 index = -1%0Ai = 3 index = -1%0Ai = 4 index = -1%0Ai = 5 index = -1%0Ai = 6 index = -1%0Ai = 7 index = -1%0Ai = 8 index = -1%0Ai = 9 index = -1%0Ai = 10 index = 10%0Ai = 11 index = 10%0Ai = 12 index = 10%0Ai = 13 index = 10%0Ai = 14 index = 10%0Ai = 15 index = 10%0Ai = 16 index = 10%0Ai = 17 index = 10%0Ai = 18 index = 10%0Ai = 19 index = 10%0Ai = 20 index = 10%0Ai = 21 index = 10%0Ai = 22 index = 10%0Ai = 23 index = 1
 0%0A*/

Add substring lookup test with lastIndexOf() for Oliver Lombart fix.