@Override
    public ClassLoaderLease registerClassLoaderLease(JobID jobId) {
        synchronized (lockObject) {
            return cacheEntries
                    .computeIfAbsent(jobId, jobID -> new LibraryCacheEntry(jobId))
                    .obtainLease();
        }
    }
@Test
    public void differentLeasesForSameJob_returnSameClassLoader() throws IOException {
        final BlobLibraryCacheManager libraryCacheManager = createSimpleBlobLibraryCacheManager();

        final JobID jobId = new JobID();
        final LibraryCacheManager.ClassLoaderLease classLoaderLease1 =
                libraryCacheManager.registerClassLoaderLease(jobId);
        final LibraryCacheManager.ClassLoaderLease classLoaderLease2 =
                libraryCacheManager.registerClassLoaderLease(jobId);

        final UserCodeClassLoader classLoader1 =
                classLoaderLease1.getOrResolveClassLoader(
                        Collections.emptyList(), Collections.emptyList());
        final UserCodeClassLoader classLoader2 =
                classLoaderLease2.getOrResolveClassLoader(
                        Collections.emptyList(), Collections.emptyList());

        assertThat(classLoader1, sameInstance(classLoader2));
    }