You're quite welcome. Two points:
1) IIRC, Class.forName ONLY throws ClassNotFoundException. It NEVER throws anything else (well, technically, any method can throw ThreadDeathException, but one should never stop that from percolating). I should be double-checked, but I think it's safe to JUST catch CNFE, which would allow you to get rid of the local variable and throw the ISE from the try block.
2) One could argue that writing a unit test for this is more trouble than it's worth. I personally disagree with this, because I think the things that are hardest to test are sometimes the things than need it most, but to each his own. Here is how I would test it. First, I would write a normal unit test that just called the constructor (this tests the "success condition" and fails if the constructor throws an exception). Then I would write the "failure condition" test like so:
A) Use the compiler tools to compile a simple, empty class named org.slf4j.helpers.Log4JLoggerFactory. Write the resulting class file to %temp%/%unitTestName%/org/slf4j/helpers/Log4JLoggerFactory.class.
B) Instantiate a java.net.URLClassLoader, using the current Thread's context class loader as the parent loader and passing in a single-element URL array to the %temp%/%unitTestName%/ directory when calling the constructor.
C) Using reflection and the custom class loader, attempt to load and instantiate the SLF4JLoggerContextFactory. Catch an InvocationTargetException. If the exception is not thrown, fail("Invocation exception not thrown.") the test. If the exception is thrown, get its cause. The cause should be an IllegalStateException. If it is some other exception, fail("Wrong exception type ___ thrown.") the test. Check to make sure the message is the same (just in case). If it's not, fail("Exception message not correct.") the test.
D) In a finally block, delete the %temp%/%unitTestName% directory.