public static void assertState(final boolean valid, final String message, final Object... args) {
    if (!valid) {
      throw new IllegalStateException(String.format(message, args));
    }
  }
This is a workaround for X bug 38288. JRockit can throw a NullPointerException from
Thread.holdsLock, so we catch the NullPointerException if it happens.

This method returns true, unless it throws an exception. This is so we can disable these tests
for performance reasons with a java assertion, eg
<code>assert Assert.assertHoldLock(lock, true);</code>

@param lock The lock to test
@param shouldBeHeld true if this thread should hold this lock.
@return true, unless the method throws an exception.
geode-core/src/main/java/org/apache/geode/internal/Assert.java