I am testing an algorithm for StringSearch and the algorithm has many IllegalAccessExceptions in it.
I wanted to test that the code is working fine with the exceptions...and it is important also to test them as they call some functions when the exception occurs.
I just wanted to know how can i implicitly generate the exception.
I am trying to use the Java Security Manager but don't know how to use it to revoke the program's access to String class.
below is the code that I am testing:
int o = offset.getInt(text);
char t = (char) value.get(text);
return instance.searchChars(t, textStart + o, textEnd + o,