import java.util.*;
import java.lang.*;
import java.lang.reflect.*;
import java.lang.annotation.*;

public class ReadForbidden {
	public static void main(String args[]) throws Exception {
		if(args.length != 1) {
			System.err.println("missing class argument");
			System.exit(-1);
		}
		String tcln = args[0];
		ClassLoader cl = ClassLoader.getSystemClassLoader();
		Class newClass = cl.loadClass(tcln);
		Forbidden forbidden = (Forbidden) newClass.getAnnotation(Forbidden.class);

		String grep = "egrep '(java/lang/ClassLoader|java\\.lang\\.ClassLoader|java/lang/reflect|java\\.lang\\.reflect";
		for (String s : forbidden.value()) {
			String escape = s.replaceAll("\\.", "\\\\.");
			grep += "|" + escape;
			escape = s.replaceAll("\\.", "/");
			grep += "|" + escape;
		}
		grep += ")'";
		System.out.println(grep);
	}
}

@@ -279,16 +279,17 @@
 1);%0A%09%09%7D%0A
+%0A
 %09%09String
@@ -293,23 +293,114 @@
 ing 
-tcln = args%5B0%5D;
+grep = %22egrep '(java/lang/ClassLoader%7Cjava%5C%5C.lang%5C%5C.ClassLoader%7Cjava/lang/reflect%7Cjava%5C%5C.lang%5C%5C.reflect%22;%0A
 %0A%09%09C
@@ -451,16 +451,46 @@
 ader();%0A
+%09%09for (String tcln : args) %7B%0A%09
 %09%09Class 
@@ -520,16 +520,17 @@
 (tcln);%0A
+%09
 %09%09Forbid
@@ -602,124 +602,9 @@
 s);%0A
-%0A
 %09
-%09String grep = %22egrep '(java/lang/ClassLoader%7Cjava%5C%5C.lang%5C%5C.ClassLoader%7Cjava/lang/reflect%7Cjava%5C%5C.lang%5C%5C.reflect%22;%0A
 %09%09fo
@@ -634,24 +634,25 @@
 .value()) %7B%0A
+%09
 %09%09%09String es
@@ -684,24 +684,25 @@
 , %22%5C%5C%5C%5C.%22);%0A
+%09
 %09%09%09grep += %22
@@ -717,16 +717,17 @@
 ape;%0A%09%09%09
+%09
 escape =
@@ -756,16 +756,17 @@
 /%22);%0A%09%09%09
+%09
 grep += 
@@ -781,17 +781,23 @@
 cape;%0A%09%09
-%7D
+%09%7D%0A%09%09%7D%0A
 %0A%09%09grep 

Allow more than one test class (at least for annotation reading).