### Question:
OzoneManagerLock { private String generateResourceName(Resource resource, String... resources) { if (resources.length == 1 && resource != Resource.BUCKET_LOCK) { return OzoneManagerLockUtil.generateResourceLockName(resource, resources[0]); } else if (resources.length == 2 && resource == Resource.BUCKET_LOCK) { return OzoneManagerLockUtil.generateBucketLockName(resources[0], resources[1]); } else { throw new IllegalArgumentException("acquire lock is supported on single" + " resource for all locks except for resource bucket"); } } OzoneManagerLock(ConfigurationSource conf); @Deprecated boolean acquireLock(Resource resource, String... resources); boolean acquireReadLock(Resource resource, String... resources); boolean acquireWriteLock(Resource resource, String... resources); boolean acquireMultiUserLock(String firstUser, String secondUser); void releaseMultiUserLock(String firstUser, String secondUser); void releaseWriteLock(Resource resource, String... resources); void releaseReadLock(Resource resource, String... resources); @Deprecated void releaseLock(Resource resource, String... resources);  }### Answer:
@Test public void acquireResourceLock() { String[] resourceName; for (OzoneManagerLock.Resource resource : OzoneManagerLock.Resource.values()) { resourceName = generateResourceName(resource); testResourceLock(resourceName, resource); } }
@Test public void reacquireResourceLock() { String[] resourceName; for (OzoneManagerLock.Resource resource : OzoneManagerLock.Resource.values()) { resourceName = generateResourceName(resource); testResourceReacquireLock(resourceName, resource); } }