@Test
  public void destroyedLockServiceThrowsLockServiceDestroyedException() throws Exception {
    final String serviceName = "service name";
    final String lockName = "abc";

    final Cache cache = new CacheFactory().create();
    final DistributedSystem distributedSystem = cache.getDistributedSystem();

    final DistributedLockService service =
        DistributedLockService.create(serviceName, distributedSystem);
    assertThat(((DLockService) service).isDestroyed()).isFalse();

    final AtomicBoolean lockAcquired = new AtomicBoolean(false);
    final AtomicBoolean serviceDestroyed = new AtomicBoolean(false);

    // get the same dls from another thread and hold a lock.
    Callable<Void> getLock = () -> {
      assertThat(catchThrowable(() -> {
        service.lock(lockName, -1, -1);
        lockAcquired.set(true);
      })).isNull();

      await().until(serviceDestroyed::get);
      service.unlock(lockName);
      return null;
    };

    // start a new thread to wait for lock
    Callable<Void> getBlocked = () -> {
      await("wait for lock to be acquired").until(
          lockAcquired::get);
      service.lock(lockName, -1, -1);
      return null;
    };

    Callable<Void> destroyLockService = () -> {
      await("lock acquired; we don't want to break that")
          .until(lockAcquired::get);
      DistributedLockService.destroy(serviceName);
      serviceDestroyed.set(true);
      return null;
    };

    concurrencyRule.add(getLock).expectExceptionType(LockServiceDestroyedException.class);
    concurrencyRule.add(getBlocked).expectExceptionType(LockServiceDestroyedException.class);
    concurrencyRule.add(destroyLockService);

    concurrencyRule.executeInParallel();
  }
Start a DLS in a thread, lock something from it in another thread, destroy it in yet a third.
geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/locks/DLockServiceCharacterizationTests.java