auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void printInfo(String dbId) { try { StringBuilder builder = new StringBuilder(); builder.append("HyperSQL Database: "); if (serverControls.containsKey(dbId)) { Server server = serverControls.get(dbId).getFirst(); builder.append("\n\tAddress : "); builder.append(server.getAddress()); builder.append("\n\tDatabase Name : "); builder.append(server.getDatabaseName(0, true)); builder.append("\n\tDatabasePath : "); builder.append(server.getDatabasePath(0, true)); builder.append("\n\tPort : "); builder.append(server.getPort()); builder.append("\n\tDefaultWebPage : "); builder.append(server.getDefaultWebPage()); builder.append("\n\tProductName : "); builder.append(server.getProductName()); builder.append("\n\tProductVersion : "); builder.append(server.getProductVersion()); builder.append("\n\tProtocol : "); builder.append(server.getProtocol()); builder.append("\n\tServerId : "); builder.append(server.getServerId()); builder.append("\n\tState : "); builder.append(server.getState()); builder.append("\n\tStateDescriptor : "); builder.append(server.getStateDescriptor()); builder.append("\n\tWebRoot : "); builder.append(server.getWebRoot()); } OseeLog.log(HyperSqlDbServer.class, Level.INFO, builder.toString()); } catch (Exception ex) { OseeLog.log(HyperSqlDbServer.class, Level.SEVERE, "Error getting Server Information", ex); } }

Target:
public void printInfo(String dbId) { try { StringBuilder builder = new StringBuilder(); builder.append("HyperSQL Database: "); Pair<Server, Thread> entry = serverControls.get(dbId); if (entry != null) { Server server = entry.getFirst(); builder.append("\n\tAddress : "); builder.append(server.getAddress()); builder.append("\n\tDatabase Name : "); builder.append(server.getDatabaseName(0, true)); builder.append("\n\tDatabasePath : "); builder.append(server.getDatabasePath(0, true)); builder.append("\n\tPort : "); builder.append(server.getPort()); builder.append("\n\tDefaultWebPage : "); builder.append(server.getDefaultWebPage()); builder.append("\n\tProductName : "); builder.append(server.getProductName()); builder.append("\n\tProductVersion : "); builder.append(server.getProductVersion()); builder.append("\n\tProtocol : "); builder.append(server.getProtocol()); builder.append("\n\tServerId : "); builder.append(server.getServerId()); builder.append("\n\tState : "); builder.append(server.getState()); builder.append("\n\tStateDescriptor : "); builder.append(server.getStateDescriptor()); builder.append("\n\tWebRoot : "); builder.append(server.getWebRoot()); } else { builder.append("\n\tDatabase not found for id: "); builder.append(dbId); } OseeLog.log(HyperSqlDbServer.class, Level.INFO, builder.toString()); } catch (Exception ex) { OseeLog.log(HyperSqlDbServer.class, Level.SEVERE, "Error getting Server Information", ex); } }
Source:
public void emitMetrics(ServiceEmitter emitter, ServiceMetricEvent.Builder metricBuilder) { if (delegate instanceof PrioritizedExecutorService) { emitter.emit(metricBuilder.build("segment/scan/pending", ((PrioritizedExecutorService) delegate).getQueueSize())); emitter.emit(metricBuilder.build("merge/buffers/size", ((DefaultBlockingPool) mergeBufferPool).getPoolSize())); } }

Target:
public void emitMetrics(ServiceEmitter emitter, ServiceMetricEvent.Builder metricBuilder) { if (delegate instanceof PrioritizedExecutorService) { emitter.emit(metricBuilder.build("segment/scan/pending", ((PrioritizedExecutorService) delegate).getQueueSize())); } }
Source:
public void run() { for (User user : this.config.getUsersInfo().getUsers()) { try { collectInstagramDataForUser(user); } catch (Exception e) { LOGGER.error("Exception thrown while polling for user, {}, skipping user.", user.getUserId()); LOGGER.error("Exception thrown while polling for user : ", e); } } this.isCompleted.set(true); }

Target:
public void run() { for (User user : this.config.getUsersInfo().getUsers()) { try { collectInstagramDataForUser(user); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } catch (Exception e) { LOGGER.error("Exception thrown while polling for user, {}, skipping user.", user.getUserId()); LOGGER.error("Exception thrown while polling for user : ", e); } } this.isCompleted.set(true); }
Source:
public String stringPrefix() { return getClass().getSimpleName() + "[" + emptyContainer.get().stringPrefix() + "]"; }

Target:
public String stringPrefix() { return "HashMultimap[" + emptyContainer.get().stringPrefix() + "]"; }
Source:
public DiskExistenceValidator createDiskExistenceValidator(Set<Guid> disksGuids) { return Injector.injectMembers(new DiskExistenceValidator(disksGuids)); }

Target:
protected DiskExistenceValidator createDiskExistenceValidator(Set<Guid> disksGuids) { return Injector.injectMembers(new DiskExistenceValidator(disksGuids)); }
Source:
private DirContext kerberosOpen(final Properties env) throws LoginException, NamingException { LoginContext ctx = new LoginContext("KerberosLogin"); ctx.login(); Subject subject = ctx.getSubject(); try { return Subject.doAs(subject, new PrivilegedExceptionAction<DirContext>() { @Override public DirContext run() throws NamingException { return new InitialDirContext(env); } }); } catch (PrivilegedActionException e) { if (e.getException() instanceof NamingException) throw (NamingException)e.getException(); if (e.getException() instanceof RuntimeException) throw (RuntimeException)e.getException(); LdapRealm.log.warn("Internal error", e.getException()); return null; } finally { ctx.logout(); } }

Target:
private DirContext kerberosOpen(final Properties env) throws LoginException, NamingException { LoginContext ctx = new LoginContext("KerberosLogin"); ctx.login(); Subject subject = ctx.getSubject(); try { return Subject.doAs(subject, new PrivilegedExceptionAction<DirContext>() { @Override public DirContext run() throws NamingException { return new InitialDirContext(env); } }); } catch (PrivilegedActionException e) { Throwables.propagateIfPossible(e.getException(), NamingException.class); Throwables.propagateIfPossible(e.getException(), RuntimeException.class); LdapRealm.log.warn("Internal error", e.getException()); return null; } finally { ctx.logout(); } }
Source:
public static void removeDanglingReferences(final Resource resource) { DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.REMOVE_DANGLING_REFERENCE_KEY); if (resource != null && resource.getResourceSet() != null) { ModelAccessor accessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(resource.getResourceSet()); SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(resource.getResourceSet()); removeDanglingReferences(accessor, new DanglingReferencesDetector(resource)); } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.REMOVE_DANGLING_REFERENCE_KEY); }

Target:
public static void removeDanglingReferences(final Resource resource) { DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.REMOVE_DANGLING_REFERENCE_KEY); if (resource != null && resource.getResourceSet() != null) { ModelAccessor accessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(resource.getResourceSet()); removeDanglingReferences(accessor, new DanglingReferencesDetector(resource)); } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.REMOVE_DANGLING_REFERENCE_KEY); }
Source:
public void initialize() { this.documents = dataParser.parse(); for (final Document document : documents) { for (int i = 0; i < document.size(); i++) { final int word = document.getWord(i); parameterWorker.push(word, new int[]{document.getAssignment(i), 1}); parameterWorker.push(numVocabs, new int[]{document.getAssignment(i), 1}); } } LOG.log(Level.INFO, "All random topic assignments are updated"); synchronizer.globalBarrier(); }

Target:
public void initialize() { this.documents = dataParser.parse(); for (final Document document : documents) { for (int i = 0; i < document.size(); i++) { final int word = document.getWord(i); batchWorker.addTopicChange(word, document.getAssignment(i), 1); batchWorker.addTopicChange(numVocabs, document.getAssignment(i), 1); } batchWorker.pushAndClear(); } LOG.log(Level.INFO, "All random topic assignments are updated"); synchronizer.globalBarrier(); }
Source:
public void checkAttributeValue(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(!attribute.equals(getAttributeValue(sess, user, attribute))) throw new WrongAttributeValueException(attribute, user, "Attribute value is not the highest value from user's UserExtSources Loas."); }

Target:
public void checkAttributeValue(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() != null) throw new WrongAttributeValueException(attribute, user, "Attribute value is null."); }
Source:
private static ICleanUp[] getCleanUps(Map<String, String> settings, Set<String> ids) { ICleanUp[] result= JavaPlugin.getDefault().getCleanUpRegistry().createCleanUps(ids); for (ICleanUp r : result) { r.setOptions(new MapCleanUpOptions(settings)); } return result; }

Target:
private static ICleanUp[] getCleanUps(Map<String, String> settings, Set<String> ids) { ICleanUp[] result= JavaPlugin.getDefault().getCleanUpRegistry().createCleanUps(ids); for (ICleanUp cleanUp : result) { cleanUp.setOptions(new MapCleanUpOptions(settings)); } return result; }
Source:
public Mono<HttpResponse> send(HttpRequest request, Context contextData) { if(request.body() != null){ request.body().map(ByteBuffer::reset); } return httpPipeline.send(request, contextData); }

Target:
public Mono<HttpResponse> send(HttpRequest request, Context contextData) { return httpPipeline.send(request, contextData); }
Source:
private List<Modification> gitLog(String... args) { InMemoryStreamConsumer outputStreamConsumer = inMemoryConsumer(); try { if (!isSubmodule) { fetch(outputStreamConsumer); } } catch (Exception e) { throw new RuntimeException(String.format("Working directory: %s\n%s", workingDir, outputStreamConsumer.getStdError()), e); } CommandLine gitCmd = git(environment).withArg("log").withArgs(args).withWorkingDir(workingDir); ConsoleResult result; try { result = runOrBomb(gitCmd); } catch (CommandLineException exception) { if (exception.getMessage().contains("Invalid revision range")) { throw new InvalidRangeException(exception.getMessage()); } else { throw exception; } } GitModificationParser parser = new GitModificationParser(); List<Modification> mods = parser.parse(result.output()); for (Modification mod : mods) { addModifiedFiles(mod); } return mods; }

Target:
private List<Modification> gitLog(String... args) { InMemoryStreamConsumer outputStreamConsumer = inMemoryConsumer(); try { if (!isSubmodule) { fetch(outputStreamConsumer); } } catch (Exception e) { throw new RuntimeException(String.format("Working directory: %s\n%s", workingDir, outputStreamConsumer.getStdError()), e); } CommandLine gitCmd = git(environment).withArg("log").withArgs(args).withWorkingDir(workingDir); ConsoleResult result = runOrBomb(gitCmd); GitModificationParser parser = new GitModificationParser(); List<Modification> mods = parser.parse(result.output()); for (Modification mod : mods) { addModifiedFiles(mod); } return mods; }
Source:
private static boolean getBoolValue(Object valueObj) throws TemplateModelException { return valueObj instanceof TemplateScalarModel && Boolean.parseBoolean(((TemplateScalarModel) valueObj).getAsString()); }

Target:
private static boolean getBoolValue(Object valueObj) throws TemplateModelException { return valueObj instanceof TemplateBooleanModel && ((TemplateBooleanModel) valueObj).getAsBoolean(); }
Source:
public void logAndThrow(RuntimeException runtimeException) { if (runtimeException == null) { return; } int currentLevel = level; if (level == DISABLED_LEVEL) { level = ERROR_LEVEL; } if (canLogAtLevel(level)) { performLogging(runtimeException.getClass().getName(), false, runtimeException); } level = currentLevel; throw runtimeException; }

Target:
public void logAndThrow(RuntimeException runtimeException) { if (runtimeException == null) { return; } if (canLogAtLevel(ERROR_LEVEL)) { logger.error(runtimeException.getMessage(), runtimeException); } throw runtimeException; }
Source:
public static URL getAccumuloSiteLocation() { String configFile = System.getProperty("accumulo.configuration", "accumulo-site.xml"); if (configFile.startsWith("file://")) { try { File f = new File(new URI(configFile)); if (f.exists() && !f.isDirectory()) { log.info("Found Accumulo configuration at {}", configFile); return f.toURI().toURL(); } else { log.warn("Failed to load Accumulo configuration at " + configFile, new Throwable()); } } catch (MalformedURLException | URISyntaxException e) { log.warn("Failed to load Accumulo configuration from " + configFile, e); } } else { URL accumuloConfigUrl = SiteConfiguration.class.getClassLoader().getResource(configFile); if (accumuloConfigUrl == null) { log.warn("Failed to load Accumulo configuration '" + configFile + "' from classpath", new Throwable()); } else { log.info("Found Accumulo configuration on classpath at {}", accumuloConfigUrl.getFile()); return accumuloConfigUrl; } } return null; }

Target:
public static URL getAccumuloSiteLocation() { String configFile = System.getProperty("accumulo.configuration", "accumulo-site.xml"); if (configFile.startsWith("file://")) { try { File f = new File(new URI(configFile)); if (f.exists() && !f.isDirectory()) { log.info("Found Accumulo configuration at {}", configFile); return f.toURI().toURL(); } else { throw new IllegalArgumentException( "Failed to load Accumulo configuration at " + configFile); } } catch (MalformedURLException | URISyntaxException e) { throw new IllegalArgumentException( "Failed to load Accumulo configuration from " + configFile, e); } } else { URL accumuloConfigUrl = SiteConfiguration.class.getClassLoader().getResource(configFile); if (accumuloConfigUrl == null) { throw new IllegalArgumentException( "Failed to load Accumulo configuration '" + configFile + "' from classpath"); } else { log.info("Found Accumulo configuration on classpath at {}", accumuloConfigUrl.getFile()); return accumuloConfigUrl; } } }
Source:
private CompletableFuture<Void> downloadOrUpdate(Collection<? extends LocallyCachedBlob> blobs) { CompletableFuture<Void>[] all = new CompletableFuture[blobs.size()]; int i = 0; for (final LocallyCachedBlob blob : blobs) { all[i] = CompletableFuture.runAsync(() -> { LOG.debug("STARTING download of {}", blob); try (ClientBlobStore blobStore = getClientBlobStore()) { boolean done = false; long failures = 0; while (!done) { try { synchronized (blob) { long localVersion = blob.getLocalVersion(); long remoteVersion = blob.getRemoteVersion(blobStore); if (localVersion != remoteVersion || !blob.isFullyDownloaded()) { if (!blob.isFullyDownloaded()) { numBlobUpdateVersionChanged.mark(); } Timer.Context t = singleBlobLocalizationDuration.time(); try { long newVersion = blob.fetchUnzipToTemp(blobStore); blob.informAllOfChangeAndWaitForConsensus(); blob.commitNewVersion(newVersion); blob.informAllChangeComplete(); t.stop(); } finally { blob.cleanupOrphanedData(); } } } done = true; } catch (Exception e) { failures++; if (failures > blobDownloadRetries) { throw new RuntimeException("Could not download...", e); } LOG.warn("Failed to download blob will try again in ms", blob, ATTEMPTS_INTERVAL_TIME, e); Utils.sleep(ATTEMPTS_INTERVAL_TIME); } } } LOG.debug("FINISHED download of {}", blob); }, execService); i++; } return CompletableFuture.allOf(all); }

Target:
private CompletableFuture<Void> downloadOrUpdate(Collection<? extends LocallyCachedBlob> blobs) { CompletableFuture<Void>[] all = new CompletableFuture[blobs.size()]; int i = 0; for (final LocallyCachedBlob blob : blobs) { all[i] = CompletableFuture.runAsync(() -> { LOG.debug("STARTING download of {}", blob); try (ClientBlobStore blobStore = getClientBlobStore()) { boolean done = false; long failures = 0; while (!done) { try { synchronized (blob) { long localVersion = blob.getLocalVersion(); long remoteVersion = blob.getRemoteVersion(blobStore); if (localVersion != remoteVersion || !blob.isFullyDownloaded()) { if (blob.isFullyDownloaded()) { numBlobUpdateVersionChanged.mark(); } Timer.Context t = singleBlobLocalizationDuration.time(); try { long newVersion = blob.fetchUnzipToTemp(blobStore); blob.informAllOfChangeAndWaitForConsensus(); blob.commitNewVersion(newVersion); blob.informAllChangeComplete(); t.stop(); } finally { blob.cleanupOrphanedData(); } } } done = true; } catch (Exception e) { failures++; if (failures > blobDownloadRetries) { throw new RuntimeException("Could not download...", e); } LOG.warn("Failed to download blob will try again in ms", blob, ATTEMPTS_INTERVAL_TIME, e); Utils.sleep(ATTEMPTS_INTERVAL_TIME); } } } LOG.debug("FINISHED download of {}", blob); }, execService); i++; } return CompletableFuture.allOf(all); }
Source:
public ImportTableDesc(String dbName, Table table) throws Exception { this.dbName = dbName; TableName tableName = HiveTableName.ofNullable(table.getTableName(), dbName); this.createTblDesc = new CreateTableDesc(tableName, false, false, table.getSd().getCols(), table.getPartitionKeys(), table.getSd().getBucketCols(), table.getSd().getSortCols(), table.getSd().getNumBuckets(), null, null, null, null, null, null, table.getSd().getInputFormat(), table.getSd().getOutputFormat(), null, table.getSd().getSerdeInfo().getSerializationLib(), null, table.getSd().getSerdeInfo().getParameters(), table.getParameters(), false, (null == table.getSd().getSkewedInfo()) ? null : table.getSd().getSkewedInfo().getSkewedColNames(), (null == table.getSd().getSkewedInfo()) ? null : table.getSd().getSkewedInfo().getSkewedColValues(), null, null, null, null, null, null, table.getColStats(), table.getTTable().getWriteId()); this.createTblDesc.setStoredAsSubDirectories(table.getSd().isStoredAsSubDirectories()); }

Target:
public ImportTableDesc(String dbName, Table table) throws Exception { if (table.getTableType() == TableType.VIRTUAL_VIEW || table.getTableType() == TableType.MATERIALIZED_VIEW) { throw new IllegalStateException("Trying to import view or materialized view: " + table.getTableName()); } this.dbName = dbName; TableName tableName = HiveTableName.ofNullable(table.getTableName(), dbName); this.createTblDesc = new CreateTableDesc(tableName, false, false, table.getSd().getCols(), table.getPartitionKeys(), table.getSd().getBucketCols(), table.getSd().getSortCols(), table.getSd().getNumBuckets(), null, null, null, null, null, null, table.getSd().getInputFormat(), table.getSd().getOutputFormat(), null, table.getSd().getSerdeInfo().getSerializationLib(), null, table.getSd().getSerdeInfo().getParameters(), table.getParameters(), false, (null == table.getSd().getSkewedInfo()) ? null : table.getSd().getSkewedInfo().getSkewedColNames(), (null == table.getSd().getSkewedInfo()) ? null : table.getSd().getSkewedInfo().getSkewedColValues(), null, null, null, null, null, null, table.getColStats(), table.getTTable().getWriteId()); this.createTblDesc.setStoredAsSubDirectories(table.getSd().isStoredAsSubDirectories()); }
Source:
public void testApplicationContextLoads() throws JobParametersInvalidException, JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, InterruptedException { myBatchJobConfig.setExpectedCount(1); myJobLauncher.run(myJob, new JobParameters()); myBatchJobConfig.awaitExpected(); }

Target:
public void testApplicationContextLoads() throws JobParametersInvalidException, JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, InterruptedException { myJobLauncher.run(myJob, new JobParameters()); }
Source:
public Iterable<ObjectNode> getAllListLead(List<String> fieldNames) { RecordPagingIterable<ObjectNode> lists = marketoRestClient.getLists(); List<Iterable<ObjectNode>> iterables = new ArrayList<>(); for (ObjectNode node : lists) { final String id = node.get("id").asText(); iterables.add(Iterables.transform(marketoRestClient.getLeadsByList(id, FluentIterable.from(fieldNames).filter(new Predicate<String>() { @Override public boolean apply(@Nullable String input) { return !LIST_ID_COLUMN_NAME.equals(input); } }).toList()), new Function<ObjectNode, ObjectNode>() { @Nullable @Override public ObjectNode apply(@Nullable ObjectNode input) { input.put(LIST_ID_COLUMN_NAME, id); return input; } })); } return Iterables.concat(iterables); }

Target:
public Iterable<ObjectNode> getAllListLead(List<String> fieldNames) { RecordPagingIterable<ObjectNode> lists = marketoRestClient.getLists(); List<Iterable<ObjectNode>> iterables = new ArrayList<>(); for (ObjectNode node : lists) { final String id = node.get("id").asText(); iterables.add(Iterables.transform(marketoRestClient.getLeadsByList(id, fieldNames), new Function<ObjectNode, ObjectNode>() { @Override public ObjectNode apply(ObjectNode input) { input.put(MarketoUtils.LIST_ID_COLUMN_NAME, id); return input; } })); } return Iterables.concat(iterables); }
Source:
public void shouldLogInAudit() throws Exception { DocumentModel doc = session.createDocumentModel("/", "a-file", "File"); doc.setPropertyValue("dc:title", "A File"); doc = session.createDocument(doc); LogEntryGen.flushAndSync(); doc.setPropertyValue("dc:title", "A modified File"); doc = session.saveDocument(doc); LogEntryGen.flushAndSync(); AuditReader reader = Framework.getLocalService(AuditReader.class); List<LogEntry> trail = reader.getLogEntriesFor(doc.getId(), doc.getRepositoryName()); Assert.assertNotNull(trail); assertEquals(2, trail.size()); LogEntry entry = trail.get(0); assertEquals(2L, entry.getId()); assertEquals("documentModified", entry.getEventId()); assertEquals("eventDocumentCategory", entry.getCategory()); assertEquals("A modified File", entry.getExtendedInfos().get("title").getValue(String.class)); entry = trail.get(1); assertEquals(1L, entry.getId()); assertEquals("documentCreated", entry.getEventId()); assertEquals("eventDocumentCategory", entry.getCategory()); assertEquals("A File", entry.getExtendedInfos().get("title").getValue(String.class)); LogEntry entryById = reader.getLogEntryByID(entry.getId()); assertEquals(entry.getId(), entryById.getId()); entryById = reader.getLogEntryByID(123L); Assert.assertNull(entryById); NXAuditEventsService audit = (NXAuditEventsService) Framework.getRuntime() .getComponent(NXAuditEventsService.NAME); AuditBackend backend = audit.getBackend(); assertEquals(1L, backend.getEventsCount(entry.getEventId()).longValue()); }

Target:
public void shouldLogInAudit() throws Exception { DocumentModel doc = session.createDocumentModel("/", "a-file", "File"); doc.setPropertyValue("dc:title", "A File"); doc = session.createDocument(doc); LogEntryGen.flushAndSync(); doc.setPropertyValue("dc:title", "A modified File"); doc = session.saveDocument(doc); LogEntryGen.flushAndSync(); AuditReader reader = Framework.getLocalService(AuditReader.class); List<LogEntry> trail = reader.getLogEntriesFor(doc.getId(), doc.getRepositoryName()); assertNotNull(trail); assertEquals(2, trail.size()); LogEntry entry = trail.get(0); assertEquals(2L, entry.getId()); assertEquals("documentModified", entry.getEventId()); assertEquals("eventDocumentCategory", entry.getCategory()); assertEquals("A modified File", entry.getExtendedInfos().get("title").getValue(String.class)); entry = trail.get(1); assertEquals(1L, entry.getId()); assertEquals("documentCreated", entry.getEventId()); assertEquals("eventDocumentCategory", entry.getCategory()); assertEquals("A File", entry.getExtendedInfos().get("title").getValue(String.class)); LogEntry entryById = reader.getLogEntryByID(entry.getId()); assertEquals(entry.getId(), entryById.getId()); entryById = reader.getLogEntryByID(123L); assertNull(entryById); NXAuditEventsService audit = (NXAuditEventsService) Framework.getRuntime() .getComponent(NXAuditEventsService.NAME); AuditBackend backend = audit.getBackend(); assertEquals(1L, backend.getEventsCount(entry.getEventId()).longValue()); }
Source:
public void testGetVariantsByExistingGenes() throws URISyntaxException { List<String> chromosomes = testGetVariantsGeneHelper("ENSG00000227232,ENSG00000227244", 2, HttpStatus.OK); assertEquals("20", chromosomes.get(0)); assertEquals("20", chromosomes.get(1)); }

Target:
public void testGetVariantsByExistingGenes() throws URISyntaxException { List<Variant> variants = testGetVariantsByGeneHelper("ENSG00000227232,ENSG00000227244", 2, HttpStatus.OK); assertEquals("20", variants.get(0).getChromosome()); assertEquals("A", variants.get(0).getReference()); assertEquals("C", variants.get(0).getAlternate()); assertEquals("20", variants.get(1).getChromosome()); assertEquals("A", variants.get(1).getReference()); assertEquals("C", variants.get(1).getAlternate()); }
Source:
public void delete(String storageId, String repositoryId, String path, boolean force) throws ArtifactOperationException { try { @SuppressWarnings("ConstantConditions") String url = getContextBaseUrl() + "/storages/" + storageId + "/" + repositoryId + "/" + path + (force ? "?force=" + force : ""); WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); Response response = resource.request().delete(); handleFailures(response, "Failed to delete artifact!"); } catch (Exception e){ e.printStackTrace(); } }

Target:
public void delete(String storageId, String repositoryId, String path, boolean force) throws ArtifactOperationException { @SuppressWarnings("ConstantConditions") String url = getContextBaseUrl() + "/storages/" + storageId + "/" + repositoryId + "/" + path + (force ? "?force=" + force : ""); WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); Response response = resource.request().delete(); handleFailures(response, "Failed to delete artifact!"); }
Source:
public ContainerDropDescription createContainerDropDescription() { ContainerDropDescriptionImpl containerDropDescription = new ContainerDropDescriptionImpl(); return containerDropDescription; }

Target:
public ContainerDropDescription createContainerDropDescription() { ContainerDropDescriptionImpl containerDropDescription = new ContainerDropDescriptionSpec(); DropContainerVariable oldContainerVariable = createDropContainerVariable(); oldContainerVariable.setName("oldSemanticContainer"); DropContainerVariable newContainerVariable = createDropContainerVariable(); newContainerVariable.setName("newSemanticContainer"); ElementDropVariable elementDropVariable = createElementDropVariable(); elementDropVariable.setName("element"); ContainerViewVariable containerViewVariable = createContainerViewVariable(); containerViewVariable.setName("newContainerView"); containerDropDescription.setElement(elementDropVariable); containerDropDescription.setNewContainer(newContainerVariable); containerDropDescription.setNewViewContainer(containerViewVariable); containerDropDescription.setOldContainer(oldContainerVariable); InitialContainerDropOperation init = createInitialContainerDropOperation(); containerDropDescription.setInitialOperation(init); return containerDropDescription; }
Source:
public void changeStudyForAdmin() throws Exception { doReturn(session).when(controller).getAuthenticatedSession(Roles.ADMIN); SignIn signIn = new SignIn.Builder().withStudy("nextStudy").build(); TestUtils.mockPlayContextWithJson(signIn); Study nextStudy = Study.create(); nextStudy.setIdentifier("nextStudy"); when(studyService.getStudy("nextStudy")).thenReturn(nextStudy); controller.changeStudyForAdmin(); assertEquals("nextStudy", session.getStudyIdentifier().getIdentifier()); verify(cacheProvider).setUserSession(session); }

Target:
public void changeStudyForAdmin() throws Exception { doReturn(session).when(controller).getAuthenticatedSession(Roles.ADMIN); SignIn signIn = new SignIn.Builder().withStudy("nextStudy").build(); Response response = TestUtils.mockPlayContextWithJson(signIn); Study nextStudy = Study.create(); nextStudy.setIdentifier("nextStudy"); when(studyService.getStudy("nextStudy")).thenReturn(nextStudy); controller.changeStudyForAdmin(); assertEquals("nextStudy", session.getStudyIdentifier().getIdentifier()); verify(cacheProvider).setUserSession(session); }
Source:
private int readNoFilter(int[] positions, int positionCount) throws IOException { int streamPosition = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { values[i] = dictionaryBlock.getPositionCount() - 1; } else { boolean isInRowDictionary = inDictionaryStream != null && !inDictionaryStream.nextBit(); int index = toIntExact(dataStream.next()); values[i] = isInRowDictionary ? stripeDictionarySize + index : index; } streamPosition++; } outputPositions = positions; outputPositionCount = positionCount; return streamPosition; }

Target:
private int readNoFilter(int[] positions, int positionCount) throws IOException { int streamPosition = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { values[i] = dictionaryBlock.getPositionCount() - 1; } else { boolean isInRowDictionary = inDictionaryStream != null && !inDictionaryStream.nextBit(); int index = toIntExact(dataStream.next()); values[i] = isInRowDictionary ? stripeDictionarySize + index : index; } streamPosition++; } outputPositionCount = positionCount; return streamPosition; }
Source:
public Page getOutput() { if (!isBlocked().isDone()) { return null; } if (state != State.FINISHING) { return null; } state = State.FINISHED; List<ComputedStatistics> statistics = getComputedStatistics(); System.out.println(statistics); outputMetadata = tableFinisher.finishTable(fragmentBuilder.build()); PageBuilder page = new PageBuilder(1, TYPES); page.declarePosition(); BIGINT.writeLong(page.getBlockBuilder(0), rowCount); return page.build(); }

Target:
public Page getOutput() { if (!isBlocked().isDone()) { return null; } if (state != State.FINISHING) { return null; } state = State.FINISHED; List<ComputedStatistics> statistics = getComputedStatistics(); outputMetadata = tableFinisher.finishTable(fragmentBuilder.build(), statistics); PageBuilder page = new PageBuilder(1, TYPES); page.declarePosition(); BIGINT.writeLong(page.getBlockBuilder(0), rowCount); return page.build(); }
Source:
protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { if (fModules == null) { return; } double[] xAxis = getXAxis(start, end, nb); setXAxis(xAxis); for (CounterAnalysis analysis : fModules) { ITmfStateSystem ss = analysis.getStateSystem(); if (ss == null) { continue; } for (Integer quark : CounterAnalysisView.getQuarks()) { try { double[] steps = new double[xAxis.length]; ITmfStateValue prev = ss.querySingleState(Math.max(ss.getStartTime(), (long) (start - (xAxis[1]))), quark).getStateValue(); for (int i = 0; i < xAxis.length; i++) { ITmfStateValue next = ss.querySingleState(start + (long) xAxis[i] - 1, quark).getStateValue(); long stateValue = prev.isNull() ? next.unboxLong() : next.unboxLong() - prev.unboxLong(); steps[i] = next.isNull() ? 0 : stateValue; prev = next; } String seriesName = createSeriesName(ss, quark); setSeries(seriesName, steps); } catch (StateSystemDisposedException e) { e.printStackTrace(); } } } updateDisplay(); }

Target:
protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { if (fModule == null) { return; } ITmfStateSystem ss = fModule.getStateSystem(); if (ss == null) { return; } double[] xAxis = getXAxis(start, end, nb); if (xAxis.length == 1) { return; } setXAxis(xAxis); for (Integer quark : fQuarks) { try { double[] steps = new double[xAxis.length]; ITmfStateValue prev = ss.querySingleState(Math.max(ss.getStartTime(), (long) (start - (xAxis[1]))), quark).getStateValue(); for (int i = 0; i < xAxis.length; i++) { ITmfStateValue next = ss.querySingleState(start + (long) xAxis[i] - 1, quark).getStateValue(); long stateValue = prev.isNull() ? next.unboxLong() : next.unboxLong() - prev.unboxLong(); steps[i] = next.isNull() ? 0 : stateValue; prev = next; } setSeries(createSeriesName(ss, quark), steps); } catch (StateSystemDisposedException e) { } } updateDisplay(); }
Source:
private void storeInputConnectors(final Model model, final Instance widget) { final List<Instance> connectors = widget.get("inputConnectors"); if (!connectors.isEmpty()) { final Instance instance = connectors.get(0); initialValueConnectors.put(widget.getUuid(), instance.copy()); if (connectors.size() > 1) { for (int i = 1; i < connectors.size(); i++) { final Instance connectorInstance = connectors.get(i); addReportChange((String) connectorInstance.get("name"), connectorInstance.getType().getEClass().getName(), connectorInstance.getUuid(), Messages.widgetDataInputMigrationDescription, Messages.connectorProperty, IStatus.ERROR); model.delete(connectorInstance); } } } }

Target:
private void storeInputConnectors(final Model model, final Instance widget) { final List<Instance> connectors = widget.get("inputConnectors"); if (!connectors.isEmpty()) { final Instance instance = connectors.get(0); initialValueConnectors.put(widget.getUuid(), instance.copy()); removeExtraConnectors(model, connectors, Messages.widgetDataInputMigrationDescription); } }
Source:
public void synchronize() throws FormAPIError { ServerFormsDetailsFetcher listDownloader = new ServerFormsDetailsFetcher(formRepository, mediaFileRepository, formAPI); List<FormDetails> formList = listDownloader.fetchFormDetails(); List<Form> formsOnDevice = formRepository.getAll(); formsOnDevice.stream().forEach(form -> { if (formList.stream().noneMatch(f -> form.getJrFormId().equals(f.getFormId()))) { formRepository.delete(form.getId()); } }); for (FormDetails form : formList) { boolean onDevice = formsOnDevice.stream().anyMatch(f -> f.getJrFormId().equals(form.getFormId())); if (!onDevice || form.isNewerFormVersionAvailable() || form.areNewerMediaFilesAvailable()) { formDownloader.downloadForm(form); } } }

Target:
public void synchronize() throws FormApiException { ServerFormsDetailsFetcher listDownloader = new ServerFormsDetailsFetcher(formRepository, mediaFileRepository, formListAPI); List<ServerFormDetails> formList = listDownloader.fetchFormDetails(); List<Form> formsOnDevice = formRepository.getAll(); formsOnDevice.stream().forEach(form -> { if (formList.stream().noneMatch(f -> form.getJrFormId().equals(f.getFormId()))) { formRepository.delete(form.getId()); } }); for (ServerFormDetails form : formList) { boolean onDevice = formsOnDevice.stream().anyMatch(f -> f.getJrFormId().equals(form.getFormId())); if (!onDevice || form.isNewerFormVersionAvailable() || form.areNewerMediaFilesAvailable()) { formDownloader.downloadForm(form); } } }
Source:
public void schedule(Topologies topologies, Cluster cluster) { Map<String, User> userMap = getUsers(cluster); List<TopologyDetails> orderedTopologies = new ArrayList<>(schedulingPriorityStrategy.getOrderedTopologies(cluster, userMap)); evictedTopologies.clear(); if (LOG.isDebugEnabled()) { LOG.debug("Ordered list of topologies is: {}", orderedTopologies.stream().map((t) -> t.getId()).collect(Collectors.toList())); } for (TopologyDetails td : orderedTopologies) { if (!cluster.needsSchedulingRas(td)) { cluster.setStatusIfAbsent(td.getId(), "Fully Scheduled"); } else { User submitter = userMap.get(td.getTopologySubmitter()); scheduleTopology(td, cluster, submitter, orderedTopologies); if (!evictedTopologies.isEmpty()) { LOG.warn("Evicted Topologies when scheduling topology: {}", evictedTopologies, td.getId()); } } } }

Target:
public void schedule(Topologies topologies, Cluster cluster) { Map<String, User> userMap = getUsers(cluster); List<TopologyDetails> orderedTopologies = new ArrayList<>(schedulingPriorityStrategy.getOrderedTopologies(cluster, userMap)); if (LOG.isDebugEnabled()) { LOG.debug("Ordered list of topologies is: {}", orderedTopologies.stream().map((t) -> t.getId()).collect(Collectors.toList())); } Map<String, Set<String>> tmpEvictedTopologiesMap = new HashMap<>(); for (TopologyDetails td : orderedTopologies) { if (!cluster.needsSchedulingRas(td)) { cluster.setStatusIfAbsent(td.getId(), "Fully Scheduled"); } else { User submitter = userMap.get(td.getTopologySubmitter()); scheduleTopology(td, cluster, submitter, orderedTopologies, tmpEvictedTopologiesMap); } } evictedTopologiesMap = tmpEvictedTopologiesMap; }
Source:
protected static ImmutableList<Ds3AnnotationElement> convertAllAnnotationElements( final ImmutableList<Ds3AnnotationElement> annotationElements, final NameMapper nameMapper) { if (annotationElements == null || annotationElements.isEmpty()) { return annotationElements; } ImmutableList.Builder<Ds3AnnotationElement> builder = ImmutableList.builder(); for (final Ds3AnnotationElement annotationElement : annotationElements) { final Ds3AnnotationElement convertedElement = new Ds3AnnotationElement( annotationElement.getName(), convertName(annotationElement.getValue(), nameMapper), convertNameWithDollarSign(annotationElement.getValueType(), nameMapper)); builder.add(convertedElement); } return builder.build(); }

Target:
protected static ImmutableList<Ds3AnnotationElement> convertAllAnnotationElements( final ImmutableList<Ds3AnnotationElement> annotationElements, final NameMapper nameMapper) { if (annotationElements == null || annotationElements.isEmpty()) { return annotationElements; } final ImmutableList.Builder<Ds3AnnotationElement> builder = ImmutableList.builder(); for (final Ds3AnnotationElement annotationElement : annotationElements) { final Ds3AnnotationElement convertedElement = new Ds3AnnotationElement( annotationElement.getName(), convertName(annotationElement.getValue(), nameMapper), convertNameWithDollarSign(annotationElement.getValueType(), nameMapper)); builder.add(convertedElement); } return builder.build(); }
Source:
public void testParameterCollectionSingletonParenthesesAndPositional() { final Item item = new Item( "Mouse", "Micro$oft mouse" ); final Item item2 = new Item( "Computer", "Dell computer" ); EntityManager em = getOrCreateEntityManager(); em.getTransaction().begin(); try { em.persist( item ); em.persist( item2 ); assertTrue( em.contains( item ) ); em.getTransaction().commit(); em.getTransaction().begin(); Query q = em.createQuery( "select item from Item item where item.name in (?1) and item.descr = ?2" ); q.setHint( "org.hibernate.fetchSize", 10 ); q.setHint( "org.hibernate.fetchSize", "10" ); List params = new ArrayList(); params.add( item2.getName() ); q.setParameter( 1, params ); q.setParameter( 2, item2.getDescr() ); List result = q.getResultList(); assertNotNull( result ); assertEquals( 1, result.size() ); } catch (Exception e){ if ( em.getTransaction() != null && em.getTransaction().isActive() ) { em.getTransaction().rollback(); } throw e; } finally { em.close(); } }

Target:
public void testParameterCollectionSingletonParenthesesAndPositional() { final Item item = new Item( "Mouse", "Microsoft mouse" ); final Item item2 = new Item( "Computer", "Dell computer" ); EntityManager em = getOrCreateEntityManager(); em.getTransaction().begin(); try { em.persist( item ); em.persist( item2 ); assertTrue( em.contains( item ) ); em.getTransaction().commit(); em.getTransaction().begin(); Query q = em.createQuery( "select item from Item item where item.name in (?1) and item.descr = ?2" ); List params = new ArrayList(); params.add( item2.getName() ); q.setParameter( 1, params ); q.setParameter( 2, item2.getDescr() ); List result = q.getResultList(); assertNotNull( result ); assertEquals( 1, result.size() ); } catch (Exception e){ if ( em.getTransaction() != null && em.getTransaction().isActive() ) { em.getTransaction().rollback(); } throw e; } finally { em.close(); } }
Source:
public void release() throws IOException { final int counter = mRetainCount.decrementAndGet(); Preconditions.checkState(counter >= 0, "Cannot release resource: retain counter is 0."); if (counter == 0) { close(); } }

Target:
public void release() throws IOException { final int counter = mRetainCount.decrementAndGet(); Preconditions.checkState(counter >= 0, String.format("Cannot release resource: retain counter is %s.", mRetainCount.get())); if (counter == 0) { close(); } }
Source:
public void createAndAddTaskMultisetParam(String queueName, String workerUrl, Map<String, String[]> paramMap) { Queue requiredQueue = QueueFactory.getQueue(queueName); TaskOptions taskToBeAdded = TaskOptions.Builder.withUrl(workerUrl); for (Map.Entry<String, String[]> entry : paramMap.entrySet()) { String name = entry.getKey(); String[] value = entry.getValue(); for (String element : value) { taskToBeAdded = taskToBeAdded.param(name, element); } } requiredQueue.add(taskToBeAdded); }

Target:
public void createAndAddTaskMultisetParam(String queueName, String workerUrl, Map<String, String[]> paramMap) { Queue requiredQueue = QueueFactory.getQueue(queueName); TaskOptions taskToBeAdded = TaskOptions.Builder.withUrl(workerUrl); for (Map.Entry<String, String[]> entry : paramMap.entrySet()) { String name = entry.getKey(); String[] values = entry.getValue(); for (String value : values) { taskToBeAdded = taskToBeAdded.param(name, value); } } requiredQueue.add(taskToBeAdded); }
Source:
public void serializeThenLoad() throws IOException { final ObjectMapper objectMapper = new ObjectMapper(); final JobKillReasonFile orignalJobKillReasonFile = new JobKillReasonFile("Test"); final byte[] bytes = objectMapper.writeValueAsBytes(orignalJobKillReasonFile); final JobKillReasonFile loadedJobKillReasonFile = objectMapper.readValue(bytes, JobKillReasonFile.class); Assert.assertEquals(orignalJobKillReasonFile.getKillReason(), loadedJobKillReasonFile.getKillReason()); }

Target:
public void serializeThenLoad() throws IOException { final ObjectMapper objectMapper = new ObjectMapper(); final JobKillReasonFile orignalJobKillReasonFile = new JobKillReasonFile(KILL_REASON_STRING); Assert.assertEquals(KILL_REASON_STRING, orignalJobKillReasonFile.getKillReason()); final byte[] bytes = objectMapper.writeValueAsBytes(orignalJobKillReasonFile); final JobKillReasonFile loadedJobKillReasonFile = objectMapper.readValue(bytes, JobKillReasonFile.class); Assert.assertEquals(KILL_REASON_STRING, loadedJobKillReasonFile.getKillReason()); }
Source:
public synchronized boolean tryToCommit(Proposal p, long zxid, SocketAddress followerAddr) { if (outstandingProposals.containsKey(zxid - 1)) { return false; } if (!p.hasAllQuorums()) { return false; } if (zxid != lastCommitted + 1) { LOG.warn( "Commiting zxid 0x{} from noy first!", Long.toHexString(zxid), followerAddr); LOG.warn("First is {}", (lastCommitted + 1)); } outstandingProposals.remove(zxid); if (p.request != null) { toBeApplied.add(p); } if (p.request == null) { LOG.warn("Going to commit null: {}", p); } else if (p.request.getHdr().getType() == OpCode.reconfig) { LOG.debug("Committing a reconfiguration! {}", outstandingProposals.size()); Long designatedLeader = getDesignatedLeader(p, zxid); QuorumVerifier newQV = p.qvAcksetPairs.get(p.qvAcksetPairs.size() - 1).getQuorumVerifier(); self.processReconfig(newQV, designatedLeader, zk.getZxid(), true); if (designatedLeader != self.getId()) { LOG.info("Committing a reconfiguration; this leader is not the designated leader anymore, setting allowedToCommit = false"); allowedToCommit = false; } commitAndActivate(zxid, designatedLeader); informAndActivate(p, designatedLeader); } else { p.request.logLatency(ServerMetrics.getMetrics().QUORUM_ACK_LATENCY); commit(zxid); inform(p); } zk.commitProcessor.commit(p.request); if (pendingSyncs.containsKey(zxid)) { for (LearnerSyncRequest r : pendingSyncs.remove(zxid)) { sendSync(r); } } return true; }

Target:
public synchronized boolean tryToCommit(Proposal p, long zxid, SocketAddress followerAddr) { if (outstandingProposals.containsKey(zxid - 1)) { return false; } if (!p.hasAllQuorums()) { return false; } if (zxid != lastCommitted + 1) { LOG.warn( "Commiting zxid 0x{} from noy first!", Long.toHexString(zxid), followerAddr); LOG.warn("First is {}", (lastCommitted + 1)); } outstandingProposals.remove(zxid); if (p.request != null) { toBeApplied.add(p); } if (p.request == null) { LOG.warn("Going to commit null: {}", p); } else if (p.request.getHdr().getType() == OpCode.reconfig) { LOG.debug("Committing a reconfiguration! {}", outstandingProposals.size()); Long designatedLeader = getDesignatedLeader(p, zxid); QuorumVerifier newQV = p.qvAcksetPairs.get(p.qvAcksetPairs.size() - 1).getQuorumVerifier(); self.processReconfig(newQV, designatedLeader, zk.getZxid(), true); if (designatedLeader != self.getId()) { LOG.info(String.format("Committing a reconfiguration (reconfigEnabled=%s); this leader is not the designated " + "leader anymore, setting allowedToCommit=false", self.isReconfigEnabled())); allowedToCommit = false; } commitAndActivate(zxid, designatedLeader); informAndActivate(p, designatedLeader); } else { p.request.logLatency(ServerMetrics.getMetrics().QUORUM_ACK_LATENCY); commit(zxid); inform(p); } zk.commitProcessor.commit(p.request); if (pendingSyncs.containsKey(zxid)) { for (LearnerSyncRequest r : pendingSyncs.remove(zxid)) { sendSync(r); } } return true; }
Source:
protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider statsProvider, Lookup lookup, Session session, Map<Symbol, Type> types) { AggregationNode aggregationNode = (AggregationNode) node; if (aggregationNode.getGroupingSets().size() != 1) { return Optional.empty(); } PlanNodeStatsEstimate sourceStats = statsProvider.getStats(aggregationNode.getSource()); List<Symbol> groupBySymbols = getOnlyElement(aggregationNode.getGroupingSets()); PlanNodeStatsEstimate.Builder result = PlanNodeStatsEstimate.builder(); for (Symbol groupBySymbol : groupBySymbols) { SymbolStatsEstimate symbolStatistics = sourceStats.getSymbolStatistics(groupBySymbol); result.addSymbolStatistics(groupBySymbol, symbolStatistics.mapNullsFraction(nullsFraction -> { if (isPositiveOrNan(nullsFraction)) { double distinctValuesCount = symbolStatistics.getDistinctValuesCount(); return 1.0 / (distinctValuesCount + 1); } return 0.0; })); } double rowsCount = 1; for (Symbol groupBySymbol : groupBySymbols) { SymbolStatsEstimate symbolStatistics = sourceStats.getSymbolStatistics(groupBySymbol); int nullRow = isPositiveOrNan(symbolStatistics.getNullsFraction()) ? 1 : 0; rowsCount *= symbolStatistics.getDistinctValuesCount() + nullRow; } result.setOutputRowCount(min(rowsCount, sourceStats.getOutputRowCount())); for (Map.Entry<Symbol, Aggregation> aggregationEntry : aggregationNode.getAggregations().entrySet()) { result.addSymbolStatistics(aggregationEntry.getKey(), estimateAggregationStats(aggregationEntry.getValue(), sourceStats)); } return Optional.of(result.build()); }

Target:
protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider statsProvider, Lookup lookup, Session session, Map<Symbol, Type> types) { AggregationNode aggregationNode = (AggregationNode) node; if (aggregationNode.getGroupingSets().size() != 1) { return Optional.empty(); } return Optional.of(groupBy( statsProvider.getStats(aggregationNode.getSource()), getOnlyElement(aggregationNode.getGroupingSets()), aggregationNode.getAggregations())); }
Source:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {1L, emptyList()}, {2L, singletonList(2L)}, {3L, singletonList(3L)}, {4L, Arrays.asList(2L, 2L)}, {6L, Arrays.asList(2L, 3L)}, {8L, Arrays.asList(2L, 2L, 2L)}, {9L, Arrays.asList(3L, 3L)}, {27L, Arrays.asList(3L, 3L, 3L)}, {625L, Arrays.asList(5L, 5L, 5L, 5L)}, {901255L, Arrays.asList(5L, 17L, 23L, 461L)}, {93819012551L, Arrays.asList(11L, 9539L, 894119L)} }); }

Target:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {1L, Collections.emptyList()}, {2L, Collections.singletonList(2L)}, {3L, Collections.singletonList(3L)}, {4L, Arrays.asList(2L, 2L)}, {6L, Arrays.asList(2L, 3L)}, {8L, Arrays.asList(2L, 2L, 2L)}, {9L, Arrays.asList(3L, 3L)}, {27L, Arrays.asList(3L, 3L, 3L)}, {625L, Arrays.asList(5L, 5L, 5L, 5L)}, {901255L, Arrays.asList(5L, 17L, 23L, 461L)}, {93819012551L, Arrays.asList(11L, 9539L, 894119L)} }); }