private static <T extends CLObjectChild> void releaseObjects(final CLObjectRegistry<T> registry, final ObjectDestructor<T> destructor) { if ( registry.isEmpty() ) return; for ( Entry<T> entry : registry.getAll() ) { final T object = entry.value; while ( object.isValid() ) destructor.release(object); } }