@Test
  public void testLockForConfigChange() throws IOException {
    LlapRegistryService client1 = null;
    LlapRegistryService client2 = null;
    ConfigChangeLockResult result;

    try {
      client1 = new LlapRegistryService(false);
      client1.init(conf);
      client1.start();

      client2 = new LlapRegistryService(false);
      client2.init(conf);
      client2.start();

      assertTrue(client1.lockForConfigChange(10000, 20000).isSuccess());
      assertTrue(client2.lockForConfigChange(30000, 40000).isSuccess());

      // Can not set to before
      result = client1.lockForConfigChange(20000, 30000);
      assertFalse(result.isSuccess());
      assertEquals(result.getNextConfigChangeTime(), 40000);

      result = client1.lockForConfigChange(30000, 40000);
      assertFalse(result.isSuccess());
      assertEquals(result.getNextConfigChangeTime(), 40000);

      result = client1.lockForConfigChange(35000, 45000);
      assertFalse(result.isSuccess());
      assertEquals(result.getNextConfigChangeTime(), 40000);

      // Can start from the previous end timestamp
      result = client1.lockForConfigChange(40000, 50000);
      assertTrue(result.isSuccess());
      assertEquals(result.getNextConfigChangeTime(), 50000);
    } finally {
      if (client1 != null) {
        client1.close();
      }
      if (client2 != null) {
        client2.close();
      }
    }
  }
Llap Registry service related tests. Currently only for configuration change.
llap-server/src/test/org/apache/hadoop/hive/llap/registry/impl/TestLlapRegistryService.java