auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void visitNode(Tree tree) { if (tree.is(Kind.CASE_CLAUSE)) { enterCase(); } else if (tree.is(Kind.LABELLED_STATEMENT)) { if (inCase()) { <START> addIssue(((LabelledStatementTree) tree).label(), <END> String.format(MESSAGE, ((LabelledStatementTree) tree).label().name())); } } else { stack.push(0); } }</code><technical_language>@pynicolas nice extract ((LabelledStatementTree) tree).label()</technical_language>

Target:
public void visitNode(Tree tree) { if (tree.is(Kind.CASE_CLAUSE)) { enterCase(); } else if (tree.is(Kind.LABELLED_STATEMENT)) { if (inCase()) { IdentifierTree label = ((LabelledStatementTree) tree).label(); addIssue(label, String.format(MESSAGE, label.name())); } } else { stack.push(0); } }
Source:
<code>public void disconnect() { logger.debug("Disconnecting"); if (readerThread != null) { logger.debug("Interrupt stream listener"); readerThread.interrupt(); } if (outWriter != null) { logger.debug("Close print writer stream"); IOUtils.closeQuietly(outWriter); } if (out != null) { logger.debug("Close tcp out stream"); IOUtils.closeQuietly(out); } if (in != null) { logger.debug("Close tcp in stream"); IOUtils.closeQuietly(in); } if (socket != null) { logger.debug("Close socket"); IOUtils.closeQuietly(socket); } readerThread = null; <START> socket = null; <END> out = null; in = null; logger.debug("Closed"); }</code><technical_language>outWriter? Move this stuff blocks, forget adding here</technical_language>

Target:
public void disconnect() { logger.debug("Disconnecting"); if (readerThread != null) { logger.debug("Interrupt stream listener"); readerThread.interrupt(); readerThread = null; } if (outWriter != null) { logger.debug("Close print writer stream"); IOUtils.closeQuietly(outWriter); outWriter = null; } if (out != null) { logger.debug("Close tcp out stream"); IOUtils.closeQuietly(out); out = null; } if (in != null) { logger.debug("Close tcp in stream"); IOUtils.closeQuietly(in); in = null; } if (socket != null) { logger.debug("Close socket"); IOUtils.closeQuietly(socket); socket = null; } logger.debug("Disconnected"); }
Source:
<code>public Operation exec(Prolog engine) { Term a1 = engine.areg1; Term a2 = engine.areg2; Term a3 = engine.areg3; Term a4 = engine.areg4; Term a5 = engine.areg5; <START> a1.dereference(); <END> a2.dereference(); a3.dereference(); a4.dereference(); a5.dereference(); String regex = a1.toString(); List<PatchListEntry> patches = (List<PatchListEntry>)((JavaObjectTerm)a5).object(); if (!patches.isEmpty()) { PatchListEntry patch = patches.get(0); String newName = patch.getNewName(); String oldName = patch.getOldName(); Patch.ChangeType changeType = patch.getChangeType(); if ((oldName != null && oldName.matches(regex)) || newName.matches(regex)) { SymbolTerm newSym = SymbolTerm.create(newName); SymbolTerm changeSym = SymbolTerm.intern(changeType.toString()); SymbolTerm oldSym = Prolog.Nil; if (oldName != null) { oldSym = SymbolTerm.create(oldName); } if (!a2.unify(newSym, engine.trail)) { return engine.fail(); } if (!a3.unify(changeSym, engine.trail)) { return engine.fail(); } if (!a4.unify(oldSym, engine.trail)) { return engine.fail(); } return engine.cont; } } return engine.fail(); }</code><technical_language>method is pointless if ignore return value. registers changing, do of dereference calls in main predicate's execute method above</technical_language>

Target:
public Operation exec(Prolog engine) { Term a1 = engine.areg1; Term a2 = engine.areg2; Term a3 = engine.areg3; Term a4 = engine.areg4; Term a5 = engine.areg5; Pattern regex = (Pattern)((JavaObjectTerm)a1).object(); Iterator<PatchListEntry> iter = (Iterator<PatchListEntry>)((JavaObjectTerm)a5).object(); if (iter.hasNext()) { PatchListEntry patch = iter.next(); String newName = patch.getNewName(); String oldName = patch.getOldName(); Patch.ChangeType changeType = patch.getChangeType(); if (regex.matcher(newName).matches() || (oldName != null && regex.matcher(oldName).matches())) { SymbolTerm changeSym = getTypeSymbol(changeType); SymbolTerm newSym = SymbolTerm.create(newName); SymbolTerm oldSym = Prolog.Nil; if (oldName != null) { oldSym = SymbolTerm.create(oldName); } if (!a2.unify(changeSym, engine.trail)) { return engine.fail(); } if (!a3.unify(newSym, engine.trail)) { return engine.fail(); } if (!a4.unify(oldSym, engine.trail)) { return engine.fail(); } return engine.cont; } } return engine.fail(); }
Source:
<code>private String path(List<GroupType> path, Type type) { StringBuilder pathString = new StringBuilder(); if (path.size() > 0) { for (int i = 1; i < path.size(); i++) { <START> pathString.append(path.get(i).getName()); <END> pathString.append("."); } } pathString.append(type.getName()); pathString.append("."); return pathString.toString(); }</code><technical_language>nit: chain pattern append returns builder object. Do a strong opinion current chained version</technical_language>

Target:
private String path(List<GroupType> path, Type type) { StringBuilder pathString = new StringBuilder(); if (path.size() > 0) { for (int i = 1; i < path.size(); i++) { pathString.append(path.get(i).getName()).append('.'); } } pathString.append(type.getName()).append('.'); return pathString.toString(); }
Source:
<code>public void doesNotRetryOnNonRetriableTransactionFailedException() throws Exception { TransactionFailedNonRetriableException failure = new TransactionFailedNonRetriableException(""); <START> when(task.run()).thenThrow(failure); <END> assertThatThrownBy(this::run).isEqualTo(failure); }</code><technical_language>add a successful response this? shows bother retrying fact</technical_language>

Target:
public void doesNotRetryOnNonRetriableTransactionFailedException() throws Exception { TransactionFailedNonRetriableException failure = new TransactionFailedNonRetriableException(""); when(task.run()).thenThrow(failure).thenReturn("success"); assertThatThrownBy(this::runExponential).isEqualTo(failure); }
Source:
<code>private HTMLOptionElement entryOption(final KieAssetsDropdownItem entry) { final HTMLOptionElement option = makeHTMLOptionElement(); option.text = entry.getText(); option.value = entry.getValue(); <START> entry.getMetaData().forEach((key, value) -> option.setAttribute(data(key), value)); <END> return option; }</code><technical_language>If your're storing meta-data in view attributes do need maintain kieAssets in KieAssetsDropdown (that appears able retrieve instance of KieAssetsDropdownItem based selected in drop-down). Personally I store meta-data in view I raise this point.. decide addressed (if all!!!)</technical_language>

Target:
private HTMLOptionElement entryOption(final KieAssetsDropdownItem entry) { final HTMLOptionElement option = makeHTMLOptionElement(); option.text = entry.getText(); option.value = entry.getValue(); option.setAttribute(SELECT_PICKER_SUBTEXT_ATTRIBUTE, entry.getSubText()); return option; }
Source:
<code>private static void delete(List<ReceiveCommand> cmds, List<ReceiveCommand> createCmds) { for (ReceiveCommand c : createCmds) { ObjectId id = c.getNewId(); String <START> n = <END> c.getRefName(); cmds.add(new ReceiveCommand(id, ObjectId.zeroId(), n)); } }</code><technical_language>s/n/name/ n is index</technical_language>

Target:
private static void delete(List<ReceiveCommand> cmds, List<ReceiveCommand> createCmds) { for (ReceiveCommand cmd : createCmds) { ObjectId id = cmd.getNewId(); String name = cmd.getRefName(); cmds.add(new ReceiveCommand(id, ObjectId.zeroId(), name)); } }
Source:
<code>public void markPlaying() { try { DownloadEntry v = videoModel; if (v != null) { if (v.watched == DownloadEntry.WatchedState.UNWATCHED) { videoModel.watched = DownloadEntry.WatchedState.PARTIALLY_WATCHED; <START> db.addVideoData(videoModel, new DataCallback<Long>() { <END> @Override public void onResult(Long result) { try { db.updateVideoWatchedState(videoModel.getVideoId(), DownloadEntry.WatchedState.PARTIALLY_WATCHED, setWatchedStateCallback); } catch (Exception ex) { logger.error(ex); } } @Override public void onFail(Exception ex) { logger.error(ex); } }); } } } catch (Exception ex) { logger.error(ex); } }</code><technical_language>pieces of code identical? factor them</technical_language>

Target:
public void markPlaying() { storage.markVideoPlaying(videoModel, watchedStateCallback); }
Source:
<code>public String forInstanceUpdateTags(String instanceName, List<String> tags) { <START> return StringUtil.join("/", _baseUrl, "instances", instanceName, "updateTags?tags=" + Joiner.on(",").join(tags)); <END> }</code><technical_language>Suggest StringUtils join suggestion return StringUtil.join("/", _baseUrl, "instances", instanceName, "updateTags?tags=" + StringUtils.join(tags, ',');</technical_language>

Target:
public String forInstanceUpdateTags(String instanceName, List<String> tags) { return StringUtil.join("/", _baseUrl, "instances", instanceName, "updateTags?tags=" + StringUtils.join(tags, ",")); }
Source:
<code>public long getLastStoredEntryId() { <START> Long lastEntry = LedgerHandle.INVALID_ENTRY_ID; <END> for (int bookieIndex : bookieIndexes) { Long lastStoredEntryIdForBookie = getLastStoredEntryId(bookieIndex); if (lastStoredEntryIdForBookie != LedgerHandle.INVALID_ENTRY_ID) { if (lastEntry == LedgerHandle.INVALID_ENTRY_ID) { lastEntry = lastStoredEntryIdForBookie; } else { lastEntry = Math.max(lastEntry, lastStoredEntryIdForBookie); } } } return lastEntry; }</code><technical_language>this 'long' instead of 'Long'</technical_language>

Target:
public long getLastStoredEntryId() { long lastEntry = LedgerHandle.INVALID_ENTRY_ID; for (int bookieIndex : bookieIndexes) { Long lastStoredEntryIdForBookie = getLastStoredEntryId(bookieIndex); if (lastStoredEntryIdForBookie != LedgerHandle.INVALID_ENTRY_ID) { if (lastEntry == LedgerHandle.INVALID_ENTRY_ID) { lastEntry = lastStoredEntryIdForBookie; } else { lastEntry = Math.max(lastEntry, lastStoredEntryIdForBookie); } } } return lastEntry; }
Source:
<code>protected void allowableSessionsExceeded(List<SessionInformation> sessions, int allowableSessions, SessionRegistry registry) throws SessionAuthenticationException { if (exceptionIfMaximumExceeded || (sessions == null)) { throw new SessionAuthenticationException(messages.getMessage( "ConcurrentSessionControlAuthenticationStrategy.exceededAllowed", new Object[] {allowableSessions}, "Maximum sessions of {0} for this principal exceeded")); } sessions.sort(Comparator.comparing(SessionInformation::getLastRequest)); int maximumSessionsExceededBy = sessions.size() - allowableSessions + 1; <START> for (int i = 0; i < maximumSessionsExceededBy; i++) { <END> sessions.get(i).expireNow(); } }</code><technical_language>sessions is defined a List means need treat this implementation of a List. If a LinkedList, iterating List List.get(int) is inefficient. Instead of List.get(int) iterator (i.e. for (SessionInformation session : sessions)). A options Iterator are: - a separate variable for determining sessions expired break out of for loop if is met. - produce [subList](<LINK_0> of sessions expire iterate</technical_language>

Target:
protected void allowableSessionsExceeded(List<SessionInformation> sessions, int allowableSessions, SessionRegistry registry) throws SessionAuthenticationException { if (exceptionIfMaximumExceeded || (sessions == null)) { throw new SessionAuthenticationException(messages.getMessage( "ConcurrentSessionControlAuthenticationStrategy.exceededAllowed", new Object[] {allowableSessions}, "Maximum sessions of {0} for this principal exceeded")); } sessions.sort(Comparator.comparing(SessionInformation::getLastRequest)); int maximumSessionsExceededBy = sessions.size() - allowableSessions + 1; List<SessionInformation> sessionsToBeExpired = sessions.subList(0, maximumSessionsExceededBy); for (SessionInformation session: sessionsToBeExpired) { session.expireNow(); } }
Source:
<code>public void theActivityCalendarProfilesAreSetOnTheDevice(final Map<String, String> settings) throws Throwable { final SetActivityCalendarAsyncRequest setActivityCalendarAsyncRequest = SetActivityCalendarRequestFactory .fromScenarioContext(); final SetActivityCalendarResponse setActivityCalendarResponse = this.smartMeteringConfigurationClient .getSetActivityCalendarResponse(setActivityCalendarAsyncRequest); LOGGER.info("Set activity calendar with result: {}", setActivityCalendarResponse.getResult().name()); <START> assertNotNull("Set activity calendar response is null", setActivityCalendarResponse.getResult()); <END> }</code><technical_language>I check if response is OK? a OK is valid for a assertNotNull</technical_language>

Target:
public void theActivityCalendarProfilesAreSetOnTheDevice(final Map<String, String> settings) throws Throwable { final SetActivityCalendarAsyncRequest setActivityCalendarAsyncRequest = SetActivityCalendarRequestFactory .fromScenarioContext(); final SetActivityCalendarResponse setActivityCalendarResponse = this.smartMeteringConfigurationClient .getSetActivityCalendarResponse(setActivityCalendarAsyncRequest); LOGGER.info("Set activity calendar with result: {}", setActivityCalendarResponse.getResult().name()); assertNotNull("Set activity calendar response is null", setActivityCalendarResponse.getResult()); assertEquals("Set activity calendar response should be OK", OsgpResultType.OK, setActivityCalendarResponse.getResult()); }
Source:
<code>protected void endWithFailure() { <START> setSucceeded(true); <END> }</code><technical_language>* shuoldn't call super? * worth adding some log.</technical_language>

Target:
protected void endWithFailure() { super.endWithFailure(); }
Source:
<code>protected DeploymentBuilder loadProjectManifest(DeploymentBuilder deploymentBuilder) { if (applicationUpgradeContextService != null && applicationUpgradeContextService.hasProjectManifest()) { try { deploymentBuilder.setProjectManifest(applicationUpgradeContextService.loadProjectManifest()); } catch (IOException e) { LOGGER.warn("Manifest of application not found. Project release version will not be set for deployment."); } } <START> if(applicationUpgradeContextService != null && applicationUpgradeContextService.hasEnforcedAppVersion()){ <END> deploymentBuilder.setEnforcedAppVersion(applicationUpgradeContextService.getEnforcedAppVersion()); LOGGER.warn("Enforced application version set to" + applicationUpgradeContextService.getEnforcedAppVersion().toString()); }else{ LOGGER.warn("Enforced application version not set."); } return deploymentBuilder; }</code><technical_language>please format spaces omitted</technical_language>

Target:
private void loadProjectManifest(DeploymentBuilder deploymentBuilder) { if (applicationUpgradeContextService.hasProjectManifest()) { try { deploymentBuilder.setProjectManifest(applicationUpgradeContextService.loadProjectManifest()); } catch (IOException e) { LOGGER.warn("Manifest of application not found. Project release version will not be set for deployment."); } } }
Source:
<code>public List<StructuredNotificationEvent> cloudbreakEventsForStack(Long stackId) { List<StructuredNotificationEvent> events = new ArrayList<>(); if (stackId != null) { events = structuredEventService.getEventsWithTypeAndResourceId(StructuredNotificationEvent.class, <START> CloudbreakEventService.DATAHUB_RESOURCE_TYPE, stackId); <END> } return events; }</code><technical_language>is datahub? I is called for datalake</technical_language>

Target:
public List<StructuredNotificationEvent> cloudbreakEventsForStack(Long stackId) { List<StructuredNotificationEvent> events = new ArrayList<>(); if (stackId != null) { StackView stackView = stackService.getViewByIdWithoutAuth(stackId); events = structuredEventService.getEventsWithTypeAndResourceId(StructuredNotificationEvent.class, stackView.getType().getResourceType(), stackId); } return events; }
Source:
<code>public NameAndDataTypeHeaderMetaData(final HasExpression hasExpression, final Optional<E> expression, final Optional<HasName> hasName, final Consumer<HasName> clearDisplayNameConsumer, final BiConsumer<HasName, Name> setDisplayNameConsumer, final BiConsumer<HasTypeRef, QName> setTypeRefConsumer, final CellEditorControlsView.Presenter cellEditorControls, final NameAndDataTypeEditorView.Presenter headerEditor) { super(cellEditorControls, headerEditor); this.hasName = hasName; this.clearDisplayNameConsumer = clearDisplayNameConsumer; this.setDisplayNameConsumer = setDisplayNameConsumer; this.setTypeRefConsumer = setTypeRefConsumer; <START> HasTypeRef hasTypeRef = expression.get(); <END> final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } this.hasTypeRef = hasTypeRef; }</code><technical_language>I new constructor existing test this new constructor. java public NameAndDataTypeHeaderMetaData(final HasExpression hasExpression, final Optional<E> expression, final Optional<HasName> hasName, final Consumer<HasName> clearDisplayNameConsumer, final BiConsumer<HasName, Name> setDisplayNameConsumer, final BiConsumer<HasTypeRef, QName> setTypeRefConsumer, final CellEditorControlsView.Presenter cellEditorControls, final NameAndDataTypeEditorView.Presenter headerEditor) { this(hasName, getTypeRefOfExpression(expression, hasExpression), clearDisplayNameConsumer, setDisplayNameConsumer, setTypeRefConsumer, cellEditorControls, headerEditor); } private static <E extends Expression> HasTypeRef getTypeRefOfExpression(final Optional<E> expression, final HasExpression hasExpression) { HasTypeRef hasTypeRef = expression.get(); final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } return hasTypeRef; }</technical_language>

Target:
public NameAndDataTypeHeaderMetaData(final HasExpression hasExpression, final Optional<E> expression, final Optional<HasName> hasName, final Consumer<HasName> clearDisplayNameConsumer, final BiConsumer<HasName, Name> setDisplayNameConsumer, final BiConsumer<HasTypeRef, QName> setTypeRefConsumer, final CellEditorControlsView.Presenter cellEditorControls, final NameAndDataTypeEditorView.Presenter headerEditor) { this(hasName, getTypeRefOfExpression(expression, hasExpression), clearDisplayNameConsumer, setDisplayNameConsumer, setTypeRefConsumer, cellEditorControls, headerEditor); }
Source:
<code>private <START> List<ISegmentAspect> getAspectsFromColumnsId(List<Long> desiredColumns) { if (!desiredColumns.isEmpty()) { List<ISegmentAspect> segmentAspects = new ArrayList<>(); for (Long columnId : desiredColumns) { ISegmentAspect segmentAspect = fAspectMap.get(columnId); if (segmentAspect != null) { segmentAspects.add(segmentAspect); } } return segmentAspects; } return new ArrayList<>(fAspectMap.values()); } <END></code><technical_language>get a linkedHashMap (like for event table)</technical_language>

Target:
private Map<Long, ISegmentAspect> getAspectsFromColumnsId(List<Long> desiredColumns) { Map<Long, ISegmentAspect> aspects = new LinkedHashMap<>(); if (!desiredColumns.isEmpty()) { for (Long columnsId : desiredColumns) { ISegmentAspect segmentAspect = fAspectMap.get(columnsId); if (segmentAspect != null) { aspects.put(columnsId, segmentAspect); } } return aspects; } return fAspectMap; }
Source:
<code>public OpenShiftProject create(String workspaceId) throws InfrastructureException { <START> boolean isPredefined = !isNullOrEmpty(this.projectName); <END> final String projectName = isPredefined ? this.projectName : workspaceId; OpenShiftProject osProject = new OpenShiftProject(clientFactory, projectName, workspaceId); osProject.prepare(); if (!isPredefined && !isNullOrEmpty(serviceAccountName)) { WorkspaceServiceAccount workspaceServiceAccount = new WorkspaceServiceAccount(workspaceId, projectName, serviceAccountName, clientFactory); workspaceServiceAccount.prepare(); } return osProject; }</code><technical_language>this line moved constructor</technical_language>

Target:
public OpenShiftProject create(String workspaceId) throws InfrastructureException { final String projectName = isPredefined() ? this.projectName : workspaceId; OpenShiftProject osProject = doCreateProject(workspaceId, projectName); osProject.prepare(); if (!isPredefined() && !isNullOrEmpty(serviceAccountName)) { WorkspaceServiceAccount workspaceServiceAccount = doCreateServiceAccount(workspaceId, projectName); workspaceServiceAccount.prepare(); } return osProject; }
Source:
<code>private ActivationKey fetchActivationKey(String keyId) { if (keyId == null || keyId.isEmpty()) { throw new BadRequestException(i18n.tr("activation key ID is null or empty")); } ActivationKey key = this.activationKeyCurator.secureGet(keyId); if (key == null) { <START> throw new BadRequestException(i18n.tr("ActivationKey with id {0} could not be found.", keyId)); <END> } return key; }</code><technical_language>controllers throwing exceptions this; resource translate</technical_language>

Target:
private ActivationKey fetchActivationKey(String keyId) { if (keyId == null || keyId.isEmpty()) { throw new IllegalArgumentException(i18n.tr("activation key ID is null or empty")); } ActivationKey key = this.activationKeyCurator.secureGet(keyId); if (key == null) { throw new NotFoundException(i18n.tr("ActivationKey with id {0} could not be found.", keyId)); } return key; }
Source:
<code>private static Field tryGetOnHierarchyChangeListenerField() { try { <START> Field field = ViewGroup.class.getDeclaredField("mOnHierarchyChangeListener"); <END> field.setAccessible(true); return field; } catch (NoSuchFieldException e) { return null; } }</code><technical_language>This refacotred ReflectionUtil, no</technical_language>

Target:
private static Field tryGetOnHierarchyChangeListenerField() { Field field = ReflectionUtil.tryGetDeclaredField( ViewGroup.class, "mOnHierarchyChangeListener"); if (field != null) { field.setAccessible(true); } return field; }
Source:
<code>private void onSafeDelete() { if (context.getEditorModelContent().getOriginalClassName() != null) { final String className = context.getEditorModelContent().getOriginalClassName(); showAssetUsagesDisplayer.showAssetUsages(Constants.INSTANCE.modelEditor_confirm_deletion_of_used_class(className), versionRecordManager.getCurrentPath(), className, ResourceType.JAVA, () -> onDelete(versionRecordManager.getPathToLatest()), () -> { <START> }); <END> } else { onDelete(versionRecordManager.getPathToLatest()); } }</code><technical_language>parameter anything, if is some location is in diff</technical_language>

Target:
public void onSafeDelete() { if (context.getEditorModelContent().getOriginalClassName() != null) { final String className = context.getEditorModelContent().getOriginalClassName(); showAssetUsagesDisplayer.showAssetUsages(Constants.INSTANCE.modelEditor_confirm_deletion_of_used_class(className), versionRecordManager.getCurrentPath(), className, ResourceType.JAVA, () -> onDelete(versionRecordManager.getPathToLatest()), () -> { }); } else { onDelete(versionRecordManager.getPathToLatest()); } }
Source:
<code>public static void main(final String[] args) { LauncherStatus status; try { status = run(args); } catch (final Exception e) { <START> LOG.log(Level.SEVERE, "Fatal exception occurred: ", e); <END> status = LauncherStatus.failed(e); } LOG.log(Level.INFO, "REEF job completed: {0}", status); }</code><technical_language>nit: Actually, I meant "Fatal exception occurred.", e</technical_language>

Target:
public static void main(final String[] args) { LauncherStatus status; try { status = run(args); } catch (final Exception e) { LOG.log(Level.SEVERE, "Fatal exception occurred.", e); status = LauncherStatus.failed(e); } LOG.log(Level.INFO, "REEF job completed: {0}", status); }
Source:
<code>private List<CloudResource> persistCloudResources( AuthenticatedContext ac, CloudStack stack, PersistenceNotifier notifier, CloudContext cloudContext, String stackName, String resourceGroupName, Deployment templateDeployment) { List<CloudResource> allResourcesToPersist = new ArrayList<>(); List<CloudResource> instances; try { <START> List<CloudResource> templateResources = azureCloudResourceService.getDeploymentCloudResources(templateDeployment); <END> allResourcesToPersist.addAll(templateResources); instances = azureCloudResourceService.getInstanceCloudResources(stackName, templateResources, stack.getGroups(), resourceGroupName); List<CloudResource> osDiskResources = azureCloudResourceService.getAttachedOsDiskResources(ac, instances, resourceGroupName); allResourcesToPersist.addAll(osDiskResources); } finally { azureCloudResourceService.deleteCloudResources(notifier, cloudContext, allResourcesToPersist); azureCloudResourceService.saveCloudResources(notifier, cloudContext, allResourcesToPersist); } return instances; }</code><technical_language>add log messages this method happening</technical_language>

Target:
private List<CloudResource> persistCloudResources( AuthenticatedContext ac, CloudStack stack, PersistenceNotifier notifier, CloudContext cloudContext, String stackName, String resourceGroupName, Deployment templateDeployment) { List<CloudResource> allResourcesToPersist = new ArrayList<>(); List<CloudResource> instances; try { List<CloudResource> templateResources = azureCloudResourceService.getDeploymentCloudResources(templateDeployment); LOGGER.debug("Template resources retrieved: {}", templateResources); allResourcesToPersist.addAll(templateResources); instances = azureCloudResourceService.getInstanceCloudResources(stackName, templateResources, stack.getGroups(), resourceGroupName); List<CloudResource> osDiskResources = azureCloudResourceService.getAttachedOsDiskResources(ac, instances, resourceGroupName); LOGGER.debug("OS disk resources retrieved: {}", osDiskResources); allResourcesToPersist.addAll(osDiskResources); } finally { azureCloudResourceService.deleteCloudResources(notifier, cloudContext, allResourcesToPersist); azureCloudResourceService.saveCloudResources(notifier, cloudContext, allResourcesToPersist); LOGGER.info("Resources persisted: {}", allResourcesToPersist); } return instances; }
Source:
<code>private AlluxioCachingFileSystem cachingFileSystem(CacheConfig cacheConfig, AlluxioCacheConfig alluxioCacheConfig) throws URISyntaxException, IOException { Map<Path, byte[]> files = new HashMap<>(); files.put(new Path(testFilePath), data); Configuration configuration = getHdfsConfiguration(cacheConfig, alluxioCacheConfig); ExtendedFileSystem testFs = new TestingFileSystem(files, configuration); URI uri = new URI("hdfs://test:8020/"); <START> AlluxioCachingFileSystem cachingFs = new AlluxioCachingFileSystem(configuration, uri, testFs, new CacheFactory()); <END> cachingFs.initialize(uri, configuration); return cachingFs; }</code><technical_language>cachingFileSystem</technical_language>

Target:
private AlluxioCachingFileSystem cachingFileSystem(CacheConfig cacheConfig, AlluxioCacheConfig alluxioCacheConfig) throws URISyntaxException, IOException { Map<Path, byte[]> files = new HashMap<>(); files.put(new Path(testFilePath), data); Configuration configuration = getHdfsConfiguration(cacheConfig, alluxioCacheConfig); ExtendedFileSystem testingFileSystem = new TestingFileSystem(files, configuration); URI uri = new URI("hdfs://test:8020/"); AlluxioCachingFileSystem cachingFileSystem = new AlluxioCachingFileSystem(testingFileSystem, uri); cachingFileSystem.initialize(uri, configuration); return cachingFileSystem; }
Source:
<code>public void includeStatsFalseShouldNotIncludeStatistics() throws Exception { Variant variant = buildVariant("12", 3, 4, "A", "T", "fileId", "studyId"); <START> VariantMongoWriter variantMongoWriter = new VariantMongoWriter(collectionName, mongoOperations, false, true); <END> variantMongoWriter.write(Collections.singletonList(variant)); DBCollection dbCollection = mongoOperations.getCollection(collectionName); assertEquals(1, dbCollection.count()); final DBObject storedVariant = dbCollection.findOne(); assertNull(storedVariant.get(STATISTICS_FIELD)); }</code><technical_language>This test test more interesting if "includeStats" parameter building VariantMongoWriter is changed (now changing include samples too). If of is required, explicit in VariantMongoWriter (I check)</technical_language>

Target:
public void includeStatsFalseShouldNotIncludeStatistics() throws Exception { Variant variant = buildVariantWithStats("12", 3, 4, "A", "T", "fileId", "studyId"); VariantMongoWriter variantMongoWriter = new VariantMongoWriter(collectionName, mongoOperations, false, false); variantMongoWriter.write(Collections.singletonList(variant)); DBCollection dbCollection = mongoOperations.getCollection(collectionName); assertEquals(1, dbCollection.count()); final DBObject storedVariant = dbCollection.findOne(); assertNull(storedVariant.get(STATISTICS_FIELD)); }
Source:
<code>private void write(final String string) { <START> if (logIsLooping()) { <END> unbindStdOutAndErrToLog(); System.err.println(string); bindStdOutAndErrToLog(); } else { logger.log(this.level, string); } }</code><technical_language>big is overhead do this check log</technical_language>

Target:
private void write(final String string) { logger.log(this.level, string); }
Source:
<code>public void testAssumptionFailure(Failure failure) { <START> ignoreCount.getAndIncrement(); <END> }</code><technical_language>In #1294 (currently targeted for 4.13) proposing updating this class collect assumption failure counts, I this change</technical_language>

Target:
public void testAssumptionFailure(Failure failure) { }
Source:
<code>public void parse(InputStream stream, boolean includeRecommends, String sumProperty) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(stream, "UTF-8")); String next = reader.readLine(); while (true) { String line = next; for (next = reader.readLine(); next != null && next.length() > 1 && next.charAt(0) == ' '; next = reader.readLine()) { line = line + next.substring(1); } if (line == null) { validateAndAddIU(); break; } if (line.trim().length() == 0) { validateAndAddIU(); continue; } if (line.startsWith("#") || line.startsWith("preamble: ") || line.startsWith("property: ") || line.startsWith("univ-checksum: ")) { } else if (line.startsWith("package: ")) { handlePackage(line); } else if (line.startsWith("version: ")) { handleVersion(line); } else if (line.startsWith("depends: ")) { handleDepends(line); } else if (line.startsWith("provides: ")) { handleProvides(line); } else if (line.startsWith("singleton:")) { handleSingleton(line); } } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (reader != null) try { reader.close(); } catch (IOException e) { } } if (TIMING) if (DEBUG) for (IInstallableUnit <START> iInstallableUnit : <END> allIUs) debug((InstallableUnit) iInstallableUnit); }</code><technical_language>rename iu</technical_language>

Target:
public void parse(InputStream stream, boolean includeRecommends, String sumProperty) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(stream, "UTF-8")); String next = reader.readLine(); while (true) { String line = next; for (next = reader.readLine(); next != null && next.length() > 1 && next.charAt(0) == ' '; next = reader.readLine()) { line = line + next.substring(1); } if (line == null) { validateAndAddIU(); break; } if (line.trim().length() == 0) { validateAndAddIU(); continue; } if (line.startsWith("#") || line.startsWith("preamble: ") || line.startsWith("property: ") || line.startsWith("univ-checksum: ")) { } else if (line.startsWith("package: ")) { handlePackage(line); } else if (line.startsWith("version: ")) { handleVersion(line); } else if (line.startsWith("depends: ")) { handleDepends(line); } else if (line.startsWith("provides: ")) { handleProvides(line); } else if (line.startsWith("singleton:")) { handleSingleton(line); } } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (reader != null) try { reader.close(); } catch (IOException e) { } } if (TIMING) if (DEBUG) for (IInstallableUnit iu : allIUs) debug((InstallableUnit) iu); }
Source:
<code>public static Object[][] rtProvider() { return new Object[][]{ <START> {"TEST STRING".getBytes(), new Version[]{CramVersions.CRAM_v2_1, CramVersions.CRAM_v3}} <END> }; }</code><technical_language>A data provider a single entry is questionable. I thinking versions separate test cases in provider (you'd duplicate test string is fine, putting getBytes call test method body) .That way, eliminate rtCheck loop, method</technical_language>

Target:
public static Object[][] rtProvider() { return new Object[][]{ {"TEST STRING".getBytes(), CramVersions.CRAM_v2_1}, {"TEST STRING".getBytes(), CramVersions.CRAM_v3} }; }
Source:
<code>public String generateLogMessage() { return Const.ActivityLog.TEAMMATESLOG + Const.ActivityLog.FIELD_SEPERATOR + servletName + Const.ActivityLog.FIELD_SEPERATOR + action + Const.ActivityLog.FIELD_SEPERATOR <START> + (toShow ? "true" : "false") + Const.ActivityLog.FIELD_SEPERATOR <END> + role + Const.ActivityLog.FIELD_SEPERATOR + name + Const.ActivityLog.FIELD_SEPERATOR + googleId + Const.ActivityLog.FIELD_SEPERATOR + email + Const.ActivityLog.FIELD_SEPERATOR + message + Const.ActivityLog.FIELD_SEPERATOR + url + Const.ActivityLog.FIELD_SEPERATOR + id; }</code><technical_language>String.valueOf(toShow) do trick</technical_language>

Target:
public String generateLogMessage() { return Const.ActivityLog.TEAMMATESLOG + Const.ActivityLog.FIELD_SEPARATOR + servletName + Const.ActivityLog.FIELD_SEPARATOR + action + Const.ActivityLog.FIELD_SEPARATOR + toShow + Const.ActivityLog.FIELD_SEPARATOR + role + Const.ActivityLog.FIELD_SEPARATOR + name + Const.ActivityLog.FIELD_SEPARATOR + googleId + Const.ActivityLog.FIELD_SEPARATOR + email + Const.ActivityLog.FIELD_SEPARATOR + message + Const.ActivityLog.FIELD_SEPARATOR + url + Const.ActivityLog.FIELD_SEPARATOR + id; }
Source:
<code><START> public BinaryValue getQueryInfo() <END> { StringBuilder sb = new StringBuilder("DELETE "); sb.append("{ "); int numKeys = this.builder.keyValues.size(); for (int i = 0; i < numKeys; i++) { if(this.builder.keyValues.get(i) == null) { sb.append("NULL"); } else { sb.append(this.builder.keyValues.get(i).toString()); } if(i < numKeys-1) { sb.append(", "); } } sb.append(" } FROM TABLE "); sb.append(this.builder.tableName.toStringUtf8()); return BinaryValue.create(sb.toString()); }</code><technical_language>is this used? curious</technical_language>

Target:
public BinaryValue getQueryInfo() { if (this.queryInfoMessage == null) { this.queryInfoMessage = createQueryInfoMessage(); } return this.queryInfoMessage; }
Source:
<code>public void equalMinorFractionsTest() { final double[] weights = new double[] {0.2, 0.3, 0.5}; final double[] minorAlleleFractions = new double[] {0.3, 0.3, 0.3}; final double memoryLength = 1e3; final AllelicBiasParameters params = new AllelicBiasParameters(0.1, 0.01, 0.03); <START> AlleleFractionHiddenMarkovModel model = new AlleleFractionHiddenMarkovModel(minorAlleleFractions, weights, <END> memoryLength, AllelicPanelOfNormals.EMPTY_PON, params); final Random random = new Random(13); final int chainLength = 10000; final List<SimpleInterval> positions = new ArrayList<>(); final List<AllelicCount> data = new ArrayList<>(); int position = 1; for (int n = 0; n < chainLength; n++) { position += random.nextInt((int) (2*memoryLength)); final SimpleInterval interval = new SimpleInterval("chr1", position, position); positions.add(interval); data.add(new AllelicCount(interval, random.nextInt(30) + 1, random.nextInt(30) + 1)); } final ForwardBackwardAlgorithm.Result<AllelicCount, SimpleInterval, Integer> fbResult = ForwardBackwardAlgorithm.apply(data, positions, model); for (int pos = 0; pos < chainLength; pos++) { for (int state = 0; state < weights.length; state++) { Assert.assertEquals(fbResult.logProbability(pos, state), Math.log(weights[state]), 1e-5); } } }</code><technical_language>final</technical_language>

Target:
public void equalMinorFractionsTest() { final double[] weights = new double[] {0.2, 0.3, 0.5}; final double[] minorAlleleFractions = new double[] {0.3, 0.3, 0.3}; final double memoryLength = 1e3; final AlleleFractionGlobalParameters params = new AlleleFractionGlobalParameters(0.1, 0.01, 0.03); final AlleleFractionHiddenMarkovModel model = new AlleleFractionHiddenMarkovModel(minorAlleleFractions, weights, memoryLength, AllelicPanelOfNormals.EMPTY_PON, params); final Random random = new Random(13); final int chainLength = 10000; final List<SimpleInterval> positions = new ArrayList<>(); final List<AllelicCount> data = new ArrayList<>(); int position = 1; for (int n = 0; n < chainLength; n++) { position += random.nextInt((int) (2*memoryLength)); final SimpleInterval interval = new SimpleInterval("chr1", position, position); positions.add(interval); data.add(new AllelicCount(interval, random.nextInt(30) + 1, random.nextInt(30) + 1)); } final ForwardBackwardAlgorithm.Result<AllelicCount, SimpleInterval, Integer> fbResult = ForwardBackwardAlgorithm.apply(data, positions, model); for (int pos = 0; pos < chainLength; pos++) { for (int state = 0; state < weights.length; state++) { Assert.assertEquals(fbResult.logProbability(pos, state), Math.log(weights[state]), 1e-5); } } }
Source:
<code>private static boolean isSubscriptionAvailable(String apiTenant, String subscriptionAvailability, String subscriptionAllowedTenants) { <START> String userDomain = RestApiUtil.getLoggedInUserTenantDomain(); <END> boolean subscriptionAllowed = false; if (!userDomain.equals(apiTenant)) { if (APIConstants.SUBSCRIPTION_TO_ALL_TENANTS.equals(subscriptionAvailability)) { subscriptionAllowed = true; } else if (APIConstants.SUBSCRIPTION_TO_SPECIFIC_TENANTS.equals(subscriptionAvailability)) { String allowedTenants[] = null; if (subscriptionAllowedTenants != null) { allowedTenants = subscriptionAllowedTenants.split(","); if (allowedTenants != null) { for (String tenant : allowedTenants) { if (tenant != null && userDomain.equals(tenant.trim())) { subscriptionAllowed = true; break; } } } } } } else { subscriptionAllowed = true; } return subscriptionAllowed; }</code><technical_language>please rename this userTenant, sounds userstore domain</technical_language>

Target:
private static boolean isSubscriptionAvailable(String apiTenant, String subscriptionAvailability, String subscriptionAllowedTenants) { String userTenant = RestApiUtil.getLoggedInUserTenantDomain(); boolean subscriptionAllowed = false; if (!userTenant.equals(apiTenant)) { if (APIConstants.SUBSCRIPTION_TO_ALL_TENANTS.equals(subscriptionAvailability)) { subscriptionAllowed = true; } else if (APIConstants.SUBSCRIPTION_TO_SPECIFIC_TENANTS.equals(subscriptionAvailability)) { String allowedTenants[] = null; if (subscriptionAllowedTenants != null) { allowedTenants = subscriptionAllowedTenants.split(","); if (allowedTenants != null) { for (String tenant : allowedTenants) { if (tenant != null && tenant.trim().equals(userTenant)) { subscriptionAllowed = true; break; } } } } } } else { subscriptionAllowed = true; } return subscriptionAllowed; }
Source:
<code>public void markAllPushTasksScheduled() { countingLock.lock(); try { allScheduled = true; <START> if (finishedPushCount != totalPushCount) { <END> return; } else { if (type == ReplicationType.COMMAND) { allPushTasksFinished.countDown(); } if (totalPushCount == 0) { return; } } } finally { countingLock.unlock(); } pushProcessing.onAllNodesReplicated(); }</code><technical_language>Is a reason, patch set 5's '<' replaced a '!='? I '<' better, exposed correspondence condition line 84. ... '<' is more robust, I do care '<', '!='. prefer '<' in cases '!=' in cases</technical_language>

Target:
public void markAllPushTasksScheduled() { countingLock.lock(); try { allScheduled = true; if (finishedPushTasksCount < totalPushTasksCount) { return; } } finally { countingLock.unlock(); } doAllPushTasksCompleted(); }
Source:
<code>public void testGetSessionServiceTokens() { prepareLooper(); boolean hasMockBrowserServiceCompat = false; boolean hasMockSessionService2 = false; boolean hasMockLibraryService2 = false; MediaSessionManager <START> sessionManager2 = <END> MediaSessionManager.getInstance(mContext); Set<SessionToken> serviceTokens = sessionManager2.getSessionServiceTokens(); for (SessionToken token2 : serviceTokens) { ComponentName componentName = token2.getComponentName(); if (MOCK_BROWSER_SERVICE_COMPAT_NAME.equals(componentName)) { hasMockBrowserServiceCompat = true; } else if (MOCK_MEDIA_SESSION_SERVICE.equals(componentName)) { hasMockSessionService2 = true; } else if (MOCK_MEDIA_LIBRARY_SERVICE.equals(componentName)) { hasMockLibraryService2 = true; } } assertTrue(hasMockBrowserServiceCompat); assertTrue(hasMockSessionService2); assertTrue(hasMockLibraryService2); }</code><technical_language>remove</technical_language>

Target:
public void testGetSessionServiceTokens() { prepareLooper(); boolean hasMockBrowserServiceCompat = false; boolean hasMockSessionService2 = false; boolean hasMockLibraryService2 = false; MediaSessionManager sessionManager = MediaSessionManager.getInstance(mContext); Set<SessionToken> serviceTokens = sessionManager.getSessionServiceTokens(); for (SessionToken token : serviceTokens) { ComponentName componentName = token.getComponentName(); if (MOCK_BROWSER_SERVICE_COMPAT_NAME.equals(componentName)) { hasMockBrowserServiceCompat = true; } else if (MOCK_MEDIA_SESSION_SERVICE.equals(componentName)) { hasMockSessionService2 = true; } else if (MOCK_MEDIA_LIBRARY_SERVICE.equals(componentName)) { hasMockLibraryService2 = true; } } assertTrue(hasMockBrowserServiceCompat); assertTrue(hasMockSessionService2); assertTrue(hasMockLibraryService2); }
Source:
<code>public void onTextChanged(CharSequence s, int start, int before, int count) { int lastCharacterLocation = start + count - 1; <START> if (s.length() > lastCharacterLocation) { <END> if (count > 0) { if (before > 0) { mLastOperation = Operation.REPLACE; mModifiedText = s.subSequence(start, start + count); } else { mLastOperation = Operation.INSERT; mOffset = start; mModifiedText = s.subSequence(start + before, start + count); } } } }</code><technical_language>If s is null, get a NPE. chance of this @Override</technical_language>

Target:
public void onTextChanged(CharSequence s, int start, int before, int count) { if (s == null) { return; } int lastCharacterLocation = start + count - 1; if (s.length() > lastCharacterLocation) { if (count > 0) { if (before > 0) { mLastOperation = Operation.REPLACE; mModifiedText = s.subSequence(start, start + count); } else { mLastOperation = Operation.INSERT; mOffset = start; mModifiedText = s.subSequence(start + before, start + count); } } } }
Source:
<code>public List<VersionVerifiedPlatform> getVerifiedPlatforms(@Parameter(hidden = true, name = "user")@Auth Optional<User> user, @Parameter(name = "entryId", description = "id of the entry", required = true, in = ParameterIn.PATH) @PathParam("entryId") Long entryId) { Entry<? extends Entry, ? extends Version> entry = toolDAO.getGenericEntryById(entryId); checkEntry(entry); if (!entry.getIsPublished()) { <START> checkUser(user.get(), entry); <END> } List<VersionVerifiedPlatform> verifiedVersions = versionDAO.findEntryVersionsWithVerifiedPlatforms(entryId); return verifiedVersions; }</code><technical_language>user.get() return null</technical_language>

Target:
public List<VersionVerifiedPlatform> getVerifiedPlatforms(@Parameter(hidden = true, name = "user")@Auth Optional<User> user, @Parameter(name = "entryId", description = "id of the entry", required = true, in = ParameterIn.PATH) @PathParam("entryId") Long entryId) { Entry<? extends Entry, ? extends Version> entry = toolDAO.getGenericEntryById(entryId); checkEntry(entry); checkEntryPermissions(user, entry); List<VersionVerifiedPlatform> verifiedVersions = versionDAO.findEntryVersionsWithVerifiedPlatforms(entryId); return verifiedVersions; }
Source:
<code>public boolean tryExpectCompletion(long timeoutMillis) throws InterruptedException { <START> while (timeoutMillis-- > 0) { <END> Optional<T> value = abq.peek(); if (value != null) { if (!value.isDefined()) { abq.poll(); return true; } return false; } Thread.sleep(1); } return false; }</code><technical_language>This is wrong assumes a millisecond pass</technical_language>

Target:
public boolean tryExpectCompletion(long timeoutMillis) throws InterruptedException { long end = System.currentTimeMillis() + timeoutMillis; do { Optional<T> value = abq.peek(); if (value != null) { if (!value.isDefined()) { abq.poll(); return true; } return false; } Thread.sleep(1); } while (System.currentTimeMillis() < end); return false; }
Source:
<code>public Collection<FormElementFilter> provideFilters(final String uuid, final Object definition) { <START> final Predicate predicate = o -> isBoundaryEvent(uuid) && isCancelActivityEnabled(uuid); <END> final FormElementFilter isInterruptingFilter = new FormElementFilter("executionSet.cancelActivity", predicate); return Collections.singletonList(isInterruptingFilter); }</code><technical_language>a must, predicate.and( o -> isCancelActivityEnabled(uuid));</technical_language>

Target:
public Collection<FormElementFilter> provideFilters(final String uuid, final Object definition) { Predicate predicate = o -> isBoundaryEvent(uuid); predicate = predicate.and(o -> isCancelActivityEnabled(uuid)); final FormElementFilter isInterruptingFilter = new FormElementFilter("executionSet.cancelActivity", predicate); return Collections.singletonList(isInterruptingFilter); }
Source:
<code>public static Location getLocation(Cluster cluster, ClusterLocationType clusterLocationType) { for (Location loc : cluster.getLocations().getLocations()) { <START> if (loc.getName().value().equals(clusterLocationType.value())) { <END> return loc; } } return null; }</code><technical_language>enum equals - loc.getName() == clusterLocationType</technical_language>

Target:
public static Location getLocation(Cluster cluster, ClusterLocationType clusterLocationType) { for (Location loc : cluster.getLocations().getLocations()) { if (loc.getName().equals(clusterLocationType)) { return loc; } } if (clusterLocationType.equals(ClusterLocationType.WORKING)) { Location staging = getLocation(cluster, ClusterLocationType.STAGING); if (staging != null) { Location working = new Location(); working.setName(ClusterLocationType.WORKING); working.setPath(staging.getPath().charAt(staging.getPath().length() - 1) == '/' ? staging.getPath().concat(WORKINGDIR) : staging.getPath().concat("/").concat(WORKINGDIR)); return working; } } return null; }
Source:
<code><START> public void verify_toString() { <END> assertThat(Health.GREEN.toString()).isEqualTo("Health{GREEN, causes=[]}"); Health.Builder builder = newHealthCheckBuilder().setStatus(randomStatus); randomCauses.forEach(builder::addCause); String underTest = builder.build().toString(); AbstractCharSequenceAssert<?, String> a = assertThat(underTest) .describedAs("toString for status %s and causes %s", randomStatus, randomCauses); if (randomCauses.isEmpty()) { a.isEqualTo("Health{" + randomStatus + ", causes=[]}"); } else if (randomCauses.size() == 1) { a.isEqualTo("Health{" + randomStatus + ", causes=[" + randomCauses.iterator().next() + "]}"); } else { a.startsWith("Health{" + randomStatus + ", causes=[") .endsWith("]}") .contains(randomCauses); } }</code><technical_language>This test is over-complex code tested. testing a trivial toString() method. Testing a single state is enough, for example GREEN 2 messages. need test cases (0, 1 more causes)</technical_language>

Target:
public void verify_toString() { assertThat(Health.GREEN.toString()).isEqualTo("Health{GREEN, causes=[]}"); Health.Builder builder = newHealthCheckBuilder().setStatus(anyStatus); randomCauses.forEach(builder::addCause); String underTest = builder.build().toString(); AbstractCharSequenceAssert<?, String> a = assertThat(underTest) .describedAs("toString for status %s and causes %s", anyStatus, randomCauses); if (randomCauses.isEmpty()) { a.isEqualTo("Health{" + anyStatus + ", causes=[]}"); } else if (randomCauses.size() == 1) { a.isEqualTo("Health{" + anyStatus + ", causes=[" + randomCauses.iterator().next() + "]}"); } else { a.startsWith("Health{" + anyStatus + ", causes=[") .endsWith("]}") .contains(randomCauses); } }