### Question:
FunctionRegistryHolder { public void addJars(Map<String, List<FunctionHolder>> newJars, long version) { try (AutoCloseableLock lock = writeLock.open()) { for (Map.Entry<String, List<FunctionHolder>> newJar : newJars.entrySet()) { String jarName = newJar.getKey(); removeAllByJar(jarName); Map<String, Queue<String>> jar = Maps.newConcurrentMap(); jars.put(jarName, jar); addFunctions(jar, newJar.getValue()); } this.version = version; } } FunctionRegistryHolder(); long getVersion(); void addJars(Map<String, List<FunctionHolder>> newJars, long version); void removeJar(String jarName); List<String> getAllJarNames(); List<String> getFunctionNamesByJar(String jarName); ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version); ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(); ListMultimap<String, String> getAllFunctionsWithSignatures(); List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version); List<DrillFuncHolder> getHoldersByFunctionName(String functionName); boolean containsJar(String jarName); int functionsSize(); String getJarNameByFunctionSignature(String functionName, String functionSignature);  }### Answer:
@Test public void testAddJars() { resetRegistry(); int functionsSize = 0; List<String> jars = Lists.newArrayList(); ListMultimap<String, DrillFuncHolder> functionsWithHolders = ArrayListMultimap.create(); ListMultimap<String, String> functionsWithSignatures = ArrayListMultimap.create(); for (Map.Entry<String, List<FunctionHolder>> jar : newJars.entrySet()) { jars.add(jar.getKey()); for (FunctionHolder functionHolder : jar.getValue()) { functionsWithHolders.put(functionHolder.getName(), functionHolder.getHolder()); functionsWithSignatures.put(functionHolder.getName(), functionHolder.getSignature()); functionsSize++; } } long expectedVersion = 0; registryHolder.addJars(newJars, ++expectedVersion); assertEquals("Version number should match", expectedVersion, registryHolder.getVersion()); compareTwoLists(jars, registryHolder.getAllJarNames()); assertEquals(functionsSize, registryHolder.functionsSize()); compareListMultimaps(functionsWithHolders, registryHolder.getAllFunctionsWithHolders()); compareListMultimaps(functionsWithSignatures, registryHolder.getAllFunctionsWithSignatures()); }