docs: @Override
      public synchronized void registerSynchronizationCallback(SynchronizationCallback sync) throws NotSupportedException {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.entry(tc, "registerSynchronizationCallback", sync);
  
          // Disallow registration of null syncs
          if (sync == null) {
              final NullPointerException npe = new NullPointerException();
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  Tr.exit(tc, "registerSynchronizationCallback", npe);
              throw npe;
          }
  
          // If this is the first registration we just add it on a new level and we're done
          if (_syncLevel < 0) {
              final ArrayList<SynchronizationCallback> newSyncList = new ArrayList<SynchronizationCallback>();
              newSyncList.add(sync);
              setLevel(newSyncList);
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  Tr.exit(tc, "registerSynchronizationCallback", _syncLevel);
              return;
          }
  
          // We clone a new sync level from the last one and add this one to it
  
          // Get the current list
          final ArrayList currentSyncList = _syncLevels.get(_syncLevel);
  
          // Current list should not be null (unless we have a logic error)
          if (currentSyncList == null) {
              // We can recover though
              final ArrayList<SynchronizationCallback> newSyncList = new ArrayList<SynchronizationCallback>();
              newSyncList.add(sync);
              setLevel(newSyncList);
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  Tr.exit(tc, "registerSynchronizationCallback", _syncLevel);
              return;
          }
  
          // Clone it with space for the new sync
          final ArrayList<SynchronizationCallback> newSyncList = new ArrayList<SynchronizationCallback>(currentSyncList);
  
          // Add the new sync on the end of the new list
          newSyncList.add(sync);
  
          // Make the new list current
          setLevel(newSyncList);
  
          // Garbage collect old levels which are no longer referenced
          garbageCollectUnusedLevels();
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.exit(tc, "registerSynchronizationCallback", _syncLevel);
      }