private static GenericListener getListener(String which) {
    GenericListener listener;
    if (which.equals("testStackOverflow")) {
      listener = listener_stackOverflow;
    } else if (which.equals("testOutOfMemory")) {
      listener = listener_outOfMemory;
    } else if (which.equals("testPersistentOutOfMemory")) {
      listener = listener_persistentOutOfMemory;
    } else if (which.equals("testMemoryMonitor")) {
      listener = listener_memoryMonitor;
    } else if (which.equals("testListener")) {
      listener = listener_internalError;
    } else if (which.equals("testInternalError")) {
      listener = listener_internalError;
    } else if (which.equals("testUnknownError")) {
      listener = listener_unknownError;
    } else if (which.equals("testError")) {
      listener = listener_error;
    } else {
      throw new AssertionError("don't know which listener: " + which);
    }
    return listener;
  }
Set a listener that generates some sort of error

@param which makes it test dependent
@return the listener
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/SystemFailureDUnitTest.java