auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void edit(final VolumeRebalanceStatusModel object) { driver.edit(object); rebalanceHostsTable.asEditor().edit(object.getRebalanceSessions()); object.getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { PropertyChangedEventArgs e = (PropertyChangedEventArgs) args; if (e.PropertyName.equals("IS_STATUS_APPLICABLE")) { status.setText(constants.rebalanceComplete()); status.setVisible(true); } else if (e.PropertyName.equals("STOP_TIME_UPDATED")) { stopTimePanel.setVisible(object.isStopTimeVisible()); <START> status.setVisible(false); <END> } } }); }</code><technical_language>status visibility follow approach stop_time</technical_language>

Target:
public void edit(final VolumeRebalanceStatusModel object) { driver.edit(object); rebalanceHostsTable.asEditor().edit(object.getRebalanceSessions()); object.getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { PropertyChangedEventArgs e = (PropertyChangedEventArgs) args; if (e.PropertyName.equals("STATUS_UPDATED")) { status.setText(constants.rebalanceComplete()); status.setVisible(object.isStatusAvailable()); } else if (e.PropertyName.equals("STOP_TIME_UPDATED")) { stopTimePanel.setVisible(object.isStopTimeVisible()); status.setVisible(object.isStatusAvailable()); } } }); }
Source:
<code>public static List<ObjectModel> loadJsonStream(InputStream input) { try { Reader reader = new InputStreamReader(input); JsonValue json = Json.parse(reader); <START> List<ObjectModel> models = new ObjectModelSerDes().deserialize(json.asArray()); <END> return models; } catch (IOException e) { LOG.error("Cannot load json model from inputstream"); } return null; }</code><technical_language>remove 'models' variable</technical_language>

Target:
public static List<ObjectModel> loadJsonStream(InputStream input) { try { Reader reader = new InputStreamReader(input); JsonValue json = Json.parse(reader); return new ObjectModelSerDes().deserialize(json.asArray()); } catch (IOException e) { LOG.error("Cannot load json model from inputstream"); } return null; }
Source:
<code><START> static protected TextView getTxtvFFFromActivity(MediaplayerActivity activity) { <END> return activity.txtvFF; }</code><technical_language>change this protected static? This order is unconventional</technical_language>

Target:
protected static TextView getTxtvFFFromActivity(MediaplayerActivity activity) { return activity.txtvFF; }
Source:
<code><START> public static List<GraphQLDirective> enforceAdd(List<GraphQLDirective> targetList, GraphQLDirective newDirective) { <END> assertNotNull(targetList, () -> "directive list can't be null"); assertNotNull(newDirective, () -> "directive can't be null"); Map<String, List<GraphQLDirective>> map = allDirectivesByName(targetList); assertNonRepeatable(newDirective, map); targetList.add(newDirective); return targetList; }</code><technical_language>Do this is more efficient implement enforceAdd: java public static List<GraphQLDirective> enforceAdd(List<GraphQLDirective> targetList, GraphQLDirective newDirective) { assertNotNull(targetList, () -> "directive list null"); assertNotNull(newDirective, () -> "directive null"); // check newDirective is repeatable in advance, avoid needless operations if(newDirective.isNonRepeatable()){ Map<String, List<GraphQLDirective>> map = allDirectivesByName(targetList); assertNonRepeatable(newDirective, map); } targetList.add(newDirective); return targetList; }</technical_language>

Target:
public static List<GraphQLDirective> enforceAdd(List<GraphQLDirective> targetList, GraphQLDirective newDirective) { assertNotNull(targetList, () -> "directive list can't be null"); assertNotNull(newDirective, () -> "directive can't be null"); if (newDirective.isNonRepeatable()) { Map<String, ImmutableList<GraphQLDirective>> map = allDirectivesByName(targetList); assertNonRepeatable(newDirective, map); } targetList.add(newDirective); return targetList; }
Source:
<code>public void setTestClass(ITestClass tc) { if (tc == null) { <START> throw new IllegalArgumentException("test class cannot be null"); <END> } m_testClass = tc; }</code><technical_language>missed a check type of classes</technical_language>

Target:
public void setTestClass(ITestClass tc) { if (tc == null) { throw new IllegalArgumentException("test class cannot be null"); } boolean assignable = m_method.getDeclaringClass().isAssignableFrom(tc.getRealClass()); if (!assignable) { throw new IllegalArgumentException( "mismatch in classes between " + tc.getName() + " and " + m_method.getDeclaringClass().getName()); } m_testClass = tc; }
Source:
<code>public void test_getContainerByFolder_cache() throws DotDataException, DotSecurityException { final User user = APILocator.systemUser(); final Host host = APILocator.getHostAPI().findDefaultHost(user, false); <START> final Folder folder = APILocator.getFolderAPI().findFolderByPath <END> (Constants.CONTAINER_FOLDER_PATH + "/large-column", host, user, false); final Container container1 = APILocator.getContainerAPI().getContainerByFolder(folder, host, user, false); final Container container2 = APILocator.getContainerAPI().getContainerByFolder(folder, host, user, false); Assert.assertTrue(container1 == container2); CacheLocator.getContainerCache().remove(container1); final Container container3 = APILocator.getContainerAPI().getContainerByFolder(folder, host, user, false); Assert.assertTrue(container3 != container2); }</code><technical_language>build tests starter data. need build data need in order able test repeatedly consistently</technical_language>

Target:
public void test_getContainerByFolder_cache() throws DotDataException, DotSecurityException, IOException { final String containerPath = Constants.CONTAINER_FOLDER_PATH + "/test-container" + System.currentTimeMillis(); this.createTestFileContainer(containerPath, APILocator.getHostAPI() .findDefaultHost(APILocator.systemUser(), false), "$dotJSON.put(\"title\", \"Test Container\""+ System.currentTimeMillis() +")\n" + "$dotJSON.put(\"description\", \"Test container\")\n" + "$dotJSON.put(\"max_contentlets\", 25)\n"); final User user = APILocator.systemUser(); final Host host = APILocator.getHostAPI().findDefaultHost(user, false); final Folder folder = APILocator.getFolderAPI().findFolderByPath (containerPath, host, user, false); final Container container1 = APILocator.getContainerAPI().getContainerByFolder(folder, host, user, false); final Container container2 = APILocator.getContainerAPI().getContainerByFolder(folder, host, user, false); Assert.assertTrue(container1 == container2); CacheLocator.getContainerCache().remove(container1); final Container container3 = APILocator.getContainerAPI().getContainerByFolder(folder, host, user, false); Assert.assertTrue(container3 != container2); }
Source:
<code>public void createNewWikiLangTC001(String lang) { WikiBasePageObject base = new WikiBasePageObject(); CreateNewWikiPageObjectStep1 cnw1 = base.openSpecialCreateNewWikiPage(wikiCorporateURL); cnw1.selectLanguage(lang); <START> String expectedDomainSufix = "en".equals(lang) ? "" : String.format("%s", lang);; <END> assertEquals(cnw1.getDomainSufix(), "fandom.com/" + expectedDomainSufix); String wikiName = cnw1.getWikiName(); cnw1.typeInWikiName(wikiName); cnw1.verifyNextButtonEnabled(); CreateNewWikiPageObjectStep2 cnw2 = cnw1.submit(); cnw2.selectCategory(CreateWikiMessages.WIKI_CATEGORY_ID); CreateNewWikiPageObjectStep3 cnw3 = cnw2.submit(); cnw3.selectThemeByName(CreateWikiMessages.WIKI_THEME); cnw3.logWikiTaskId(); ArticlePageObject article = cnw3.submit(); article.verifyWikiTitleOnCongratualtionsLightBox(wikiName); article.closeNewWikiCongratulationsLightBox(); article.verifyWikiTitleHeader(wikiName); new WikiFactory().setIsTestWiki(article.getWikiID(), true); article.verifyUserLoggedIn(User.USER_CNW.getUserName()); }</code><technical_language>Hmm, a regular if more straight in test body :)</technical_language>

Target:
public void createNewWikiLangTC001(String lang) { WikiBasePageObject base = new WikiBasePageObject(); CreateNewWikiPageObjectStep1 cnw1 = base.openSpecialCreateNewWikiPage(wikiCorporateURL); cnw1.selectLanguage(lang); String expectedDomainSufix; if (lang.equals("en")) { expectedDomainSufix = String.format(""); } else { expectedDomainSufix = String.format("%s", lang); } assertEquals(cnw1.getDomainSufix(), "fandom.com/" + expectedDomainSufix); String wikiName = cnw1.getWikiName(); cnw1.typeInWikiName(wikiName); cnw1.verifyNextButtonEnabled(); CreateNewWikiPageObjectStep2 cnw2 = cnw1.submit(); cnw2.selectCategory(CreateWikiMessages.WIKI_CATEGORY_ID); CreateNewWikiPageObjectStep3 cnw3 = cnw2.submit(); cnw3.selectThemeByName(CreateWikiMessages.WIKI_THEME); cnw3.logWikiTaskId(); ArticlePageObject article = cnw3.submit(); article.verifyWikiTitleOnCongratualtionsLightBox(wikiName); article.closeNewWikiCongratulationsLightBox(); article.verifyWikiTitleHeader(wikiName); new WikiFactory().setIsTestWiki(article.getWikiID(), true); article.verifyUserLoggedIn(User.USER_CNW.getUserName()); }
Source:
<code>private void cleanUpActivity(final ArrayList<TimeData> activityData, final boolean isIndoorTour) { Collections.sort(activityData, new Comparator<TimeData>() { @Override public int compare(final TimeData firstTimeData, final TimeData secondTimeData) { return firstTimeData.absoluteTime > secondTimeData.absoluteTime ? 1 : (firstTimeData.absoluteTime < secondTimeData.absoluteTime) ? -1 : 0; } }); final Iterator<TimeData> sampleListIterator = activityData.iterator(); long previousAbsoluteTime = 0; while (sampleListIterator.hasNext()) { final TimeData currentTimeData = sampleListIterator.next(); if (currentTimeData.marker == 0 && (!isIndoorTour && currentTimeData.longitude == Double.MIN_VALUE && currentTimeData.latitude == Double.MIN_VALUE) || (isIndoorTour && currentTimeData.absoluteAltitude == Float.MIN_VALUE) || currentTimeData.absoluteTime == previousAbsoluteTime) { sampleListIterator.remove(); } else { previousAbsoluteTime = currentTimeData.absoluteTime; } } if (_lapCounter != 0) { <END> <START> final TimeData lastTimeData = activityData.get(activityData.size() - 1); lastTimeData.marker = 1; lastTimeData.markerLabel = Integer.toString(++_lapCounter); } }</code><technical_language>a while, prefix num for number of avoid longer names, e.g. numberOf counter -> numLaps</technical_language>

Target:
private void cleanUpActivity(final ArrayList<TimeData> activityData, final boolean isIndoorTour) { Collections.sort(activityData, new Comparator<TimeData>() { @Override public int compare(final TimeData firstTimeData, final TimeData secondTimeData) { return firstTimeData.absoluteTime > secondTimeData.absoluteTime ? 1 : (firstTimeData.absoluteTime < secondTimeData.absoluteTime) ? -1 : 0; } }); final Iterator<TimeData> sampleListIterator = activityData.iterator(); long previousAbsoluteTime = 0; while (sampleListIterator.hasNext()) { final TimeData currentTimeData = sampleListIterator.next(); if (currentTimeData.marker == 0 && (!isIndoorTour && currentTimeData.longitude == Double.MIN_VALUE && currentTimeData.latitude == Double.MIN_VALUE) || (isIndoorTour && currentTimeData.absoluteAltitude == Float.MIN_VALUE) || currentTimeData.absoluteTime == previousAbsoluteTime) { sampleListIterator.remove(); } else { previousAbsoluteTime = currentTimeData.absoluteTime; } } if (_numLaps != 0) { final TimeData lastTimeData = activityData.get(activityData.size() - 1); lastTimeData.marker = 1; lastTimeData.markerLabel = Integer.toString(++_numLaps); } }
Source:
<code>public void stop() { <START> INSTANCE = null; <END> }</code><technical_language>fix</technical_language>

Target:
public void stop() { instance = null; }
Source:
<code>private static void ChaosServiceStart(Configuration conf, ChaosServiceName serviceName) { switch (serviceName) { case chaosagent: ChaosAgent.stopChaosAgent.set(false); try { Thread t = new Thread(new ChaosAgent(conf, ChaosUtils.getZKQuorum(conf), ChaosUtils.getHostName())); t.start(); t.join(); } catch (InterruptedException | UnknownHostException e) { <START> LOG.error("Failed while executing next task execution of ChaosAgent on : " + serviceName + " : " + e); <END> } break; default: LOG.error("Service Name not known : " + serviceName.toString()); } }</code><technical_language>above, placeholders + exception arg</technical_language>

Target:
private static void ChaosServiceStart(Configuration conf, ChaosServiceName serviceName) { switch (serviceName) { case CHAOSAGENT: ChaosAgent.stopChaosAgent.set(false); try { Thread t = new Thread(new ChaosAgent(conf, ChaosUtils.getZKQuorum(conf), ChaosUtils.getHostName())); t.start(); t.join(); } catch (InterruptedException | UnknownHostException e) { LOG.error("Failed while executing next task execution of ChaosAgent on : {}", serviceName, e); } break; default: LOG.error("Service Name not known : " + serviceName.toString()); } }
Source:
<code>public Entity<TreeReference> getEntity(TreeReference data) { EvaluationContext nodeContext = new EvaluationContext(ec, data); if (inDebugMode) { nodeContext.setDebugModeOn(reporter); } detail.populateEvaluationContextVariables(nodeContext); int length = detail.getHeaderForms().length; String extraKey = loadCalloutDataMapKey(nodeContext); Object[] fieldData = new Object[length]; String[] sortData = new String[length]; boolean[] relevancyData = new boolean[length]; int count = 0; for (DetailField f : detail.getFields()) { try { fieldData[count] = f.getTemplate().evaluate(nodeContext); Text sortText = f.getSort(); if (sortText == null) { sortData[count] = null; } else { sortData[count] = sortText.evaluate(nodeContext); } relevancyData[count] = f.isRelevant(nodeContext); } catch (XPathSyntaxException | XPathException e) { <START> XPathException xe = new XPathException(e); <END> throw xe; } count++; } return new Entity<>(fieldData, sortData, relevancyData, data, extraKey, detail.evaluateFocusFunction(nodeContext)); }</code><technical_language>For reason of change in android part of this PR, want create this wrapped exception if original exception XPathSyntaxException? issue of wrapping XPathSyntaxException another XPathSyntaxException</technical_language>

Target:
public Entity<TreeReference> getEntity(TreeReference data) { EvaluationContext nodeContext = new EvaluationContext(ec, data); if (inDebugMode) { nodeContext.setDebugModeOn(reporter); } detail.populateEvaluationContextVariables(nodeContext); int length = detail.getHeaderForms().length; String extraKey = loadCalloutDataMapKey(nodeContext); Object[] fieldData = new Object[length]; String[] sortData = new String[length]; boolean[] relevancyData = new boolean[length]; int count = 0; for (DetailField f : detail.getFields()) { try { fieldData[count] = f.getTemplate().evaluate(nodeContext); Text sortText = f.getSort(); if (sortText == null) { sortData[count] = null; } else { sortData[count] = sortText.evaluate(nodeContext); } relevancyData[count] = f.isRelevant(nodeContext); } catch (XPathSyntaxException e) { XPathException xe = new XPathException(e); throw xe; } count++; } return new Entity<>(fieldData, sortData, relevancyData, data, extraKey, detail.evaluateFocusFunction(nodeContext)); }
Source:
<code>public int validateOkToDelete(DeleteConflictList theDeleteConflicts, ResourceTable theEntity, boolean theForValidate) { DeleteConflictList newConflicts = new DeleteConflictList(); <START> boolean tryAgain = findAndHandleConflicts(newConflicts, theEntity, theForValidate, MIN_QUERY_RESULT_COUNT); <END> int retryCount = 0; while (tryAgain && retryCount < MAX_RETRY_ATTEMPTS) { newConflicts = new DeleteConflictList(); tryAgain = findAndHandleConflicts(newConflicts, theEntity, theForValidate, MAX_RETRY_COUNT); ++retryCount; } theDeleteConflicts.addAll(newConflicts); return retryCount; }</code><technical_language>trouble understanding this bit.. rationale for passing 1 max 60 later? is count called MAX_RETRY_COUNT? I find name confusing MAX_RETRY_ATTEMPTS</technical_language>

Target:
public int validateOkToDelete(DeleteConflictList theDeleteConflicts, ResourceTable theEntity, boolean theForValidate) { DeleteConflictList newConflicts = new DeleteConflictList(); boolean tryAgain = findAndHandleConflicts(newConflicts, theEntity, theForValidate, FIRST_QUERY_RESULT_COUNT); int retryCount = 0; while (tryAgain && retryCount < MAX_RETRY_ATTEMPTS) { newConflicts = new DeleteConflictList(); tryAgain = findAndHandleConflicts(newConflicts, theEntity, theForValidate, RETRY_QUERY_RESULT_COUNT); ++retryCount; } theDeleteConflicts.addAll(newConflicts); return retryCount; }
Source:
<code>public void testTextQueryLimitedConcurrent() throws Exception { final IgniteEx ignite = grid(0); final String clause = "1*"; Set<Integer> exp = populateCache(ignite, false, MAX_ITEM_COUNT, (IgnitePredicate<Integer>)x -> String.valueOf(x).startsWith("1")); ExecutorService executor = Executors.newFixedThreadPool(N_THREADS); <START> IntStream.range(0, N_THREADS).forEach((i) -> executor.submit(textQueryTask(ignite, clause, exp))); <END> executor.shutdown(); executor.awaitTermination(1, TimeUnit.MINUTES); clearCache(ignite); }</code><technical_language>errors submitted tasks do propagate main test thread. failures in tasks fail test. I suggest org.apache.ignite.testframework.GridTestUtils#runMultiThreaded(java.lang.Runnable, int, java.lang.String) someting similar java.util.concurrent.ExecutorService#invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>>) (and waiting futures)</technical_language>

Target:
public void testTextQueryLimitedConcurrent() throws Exception { final IgniteEx ignite = grid(0); final String clause = "1*"; Set<Integer> exp = populateCache(ignite, false, MAX_ITEM_COUNT, (IgnitePredicate<Integer>)x -> String.valueOf(x).startsWith("1")); GridTestUtils.runMultiThreaded(textQueryTask(ignite, clause, exp), N_THREADS, "text-query-test"); clearCache(ignite); }
Source:
<code>public static void main(String[] args) { Blade.me() .get("/json", (request, response) -> response.json(new Message())) .get("/db", (request, response) -> { final Random random = ThreadLocalRandom.current(); response.json(new World().find(random.nextInt(DB_ROWS) + 1)); }) .get("/queries", (request, response) -> { int queries = getQueries(request.queryInt("queries")); final World[] worlds = new World[queries]; final Random random = ThreadLocalRandom.current(); for (int i = 0; i < queries; i++) { worlds[i] = new World().find(random.nextInt(DB_ROWS) + 1); } response.json(worlds); }) <START> .get("/plaintext", (request, response) -> response.body(Unpooled.unreleasableBuffer(Unpooled.directBuffer().writeBytes(STATIC_HELLO_TEXT)).duplicate())) <END> .listen(8080).start(Application.class, args); }</code><technical_language>@nbrady-techempower Do enforce other implementations this label Stripped (rather Realistic)? Feels hax here, I some other implementations do this</technical_language>

Target:
public static void main(String[] args) { Blade.me() .get("/json", (request, response) -> response.json(new Message())) .get("/db", (request, response) -> { final Random random = ThreadLocalRandom.current(); response.json(new World().find(random.nextInt(DB_ROWS) + 1)); }) .get("/queries", (request, response) -> { int queries = getQueries(request.queryInt("queries")); final World[] worlds = new World[queries]; final Random random = ThreadLocalRandom.current(); for (int i = 0; i < queries; i++) { worlds[i] = new World().find(random.nextInt(DB_ROWS) + 1); } response.json(worlds); }) .get("/plaintext", (request, response) -> response.body(Unpooled.unreleasableBuffer(Unpooled.directBuffer().writeBytes(STATIC_HELLO_TEXT)).duplicate())) .start(Application.class, args); }
Source:
<code>public int[] write(ClassWriter cw, MethodVisitor mv, Method method, Parameter param, int local) { mv.visitVarInsn(ALOAD, 1); mv.visitTypeInsn(CHECKCAST, "org/spongepowered/api/event/cause/CauseTracked"); mv.visitMethodInsn(INVOKEINTERFACE, "org/spongepowered/api/event/cause/CauseTracked", "getCause", "()Lorg/spongepowered/api/event/cause/Cause;", true); Class<?> targetType = param.getType(); insertCauseCall(mv, param, targetType); int paramLocal = local++; mv.visitVarInsn(ASTORE, paramLocal); insertCheck(mv, param, targetType, paramLocal); insertTransform(mv, param, targetType, paramLocal); <START> return new int[] {local, paramLocal}; <END> }</code><technical_language>API depend Apache Common? Tuple</technical_language>

Target:
public Tuple<Integer, Integer> write(ClassWriter cw, MethodVisitor mv, Method method, Parameter param, int local) { mv.visitVarInsn(ALOAD, 1); mv.visitTypeInsn(CHECKCAST, Type.getInternalName(CauseTracked.class)); mv.visitMethodInsn(INVOKEINTERFACE, Type.getInternalName(CauseTracked.class), "getCause", "()" + Type.getDescriptor(Cause.class), true); Class<?> targetType = param.getType(); insertCauseCall(mv, param, targetType); int paramLocal = local++; mv.visitVarInsn(ASTORE, paramLocal); insertCheck(mv, param, targetType, paramLocal); insertTransform(mv, param, targetType, paramLocal); return new Tuple<>(local, paramLocal); }
Source:
<code>public void testColourMapEmpty() throws Exception { String yaml = "raster: \n" + " color-map:\n" + " type: values\n" + " entries:\n" + " - "+tuple("#ff0000", "1.0", "0", "start")+"\n" + " - "+tuple("#00ff00", "", "500", "middle")+"\n" + " - "+tuple("#0000ff", null, "1000", "end")+"\n" + ""; StyledLayerDescriptor sld = Ysld.parse(yaml); FeatureTypeStyle fs = SLD.defaultStyle(sld).featureTypeStyles().get(0); RasterSymbolizer symb = (RasterSymbolizer) fs.rules().get(0).symbolizers().get(0); ColorMap map = (ColorMap) symb.getColorMap(); System.out.println(map.getColorMapEntry(0).getColor().evaluate(null)); String colour1 = (String) map.getColorMapEntry(0).getColor().evaluate(null); String colour2 = (String) map.getColorMapEntry(1).getColor().evaluate(null); String colour3 = (String) map.getColorMapEntry(2).getColor().evaluate(null); assertThat(colour1, is("#FF0000")); assertThat(colour2, is("#00FF00")); <START> assertThat(colour3, is("#0000FF")); <END> }</code><technical_language>tests work as-is. If don't, broken some other behaviour in YSLD</technical_language>

Target:
public void testColourMapEmpty() throws Exception { String yaml = "raster: \n" + " color-map:\n" + " type: values\n" + " entries:\n" + " - "+tuple("#ff0000", "1.0", "0", "start")+"\n" + " - "+tuple("#00ff00", "", "500", "middle")+"\n" + " - "+tuple("#0000ff", null, "1000", "end")+"\n" + ""; StyledLayerDescriptor sld = Ysld.parse(yaml); FeatureTypeStyle fs = SLD.defaultStyle(sld).featureTypeStyles().get(0); RasterSymbolizer symb = (RasterSymbolizer) fs.rules().get(0).symbolizers().get(0); ColorMap map = (ColorMap) symb.getColorMap(); System.out.println(map.getColorMapEntry(0).getColor().evaluate(null)); Color colour1 = (Color) map.getColorMapEntry(0).getColor().evaluate(null); Color colour2 = (Color) map.getColorMapEntry(1).getColor().evaluate(null); Color colour3 = (Color) map.getColorMapEntry(2).getColor().evaluate(null); assertThat(colour1, is(Color.RED)); assertThat(colour2, is(Color.GREEN)); assertThat(colour3, is(Color.BLUE)); }
Source:
<code>FunctionSymbolImpl(FunctionDef functionDef, @Nullable String fullyQualifiedName) { super(functionDef.name().name(), fullyQualifiedName); setKind(Kind.FUNCTION); isInstanceMethod = isInstanceMethod(functionDef); hasDecorators = !functionDef.decorators().isEmpty(); <START> ParameterList parameters = functionDef.parameters(); <END> if (parameters != null) { createParameterNames(parameters.all()); } }</code><technical_language>is a code smell this name hides defined a class attribute line 34. mind renaming variable avoid it</technical_language>

Target:
FunctionSymbolImpl(FunctionDef functionDef, @Nullable String fullyQualifiedName) { super(functionDef.name().name(), fullyQualifiedName); setKind(Kind.FUNCTION); isInstanceMethod = isInstanceMethod(functionDef); hasDecorators = !functionDef.decorators().isEmpty(); ParameterList parametersList = functionDef.parameters(); if (parametersList != null) { createParameterNames(parametersList.all()); } }
Source:
<code>public SubSequenceStrategyBuilder subSequence(InputTypeStrategy inputTypeStrategy) { <START> Optional<Integer> maxCount = inputTypeStrategy.getArgumentCount().getMaxCount(); <END> Optional<Integer> minCount = inputTypeStrategy.getArgumentCount().getMinCount(); if (!maxCount.isPresent() || !minCount.isPresent() || !maxCount.get().equals(minCount.get())) { throw new IllegalArgumentException("Both the minimum and maximum number of expected arguments must" + " be defined and equal to each other."); } argumentsSplits.add(new ArgumentsSplit(currentPos, currentPos + maxCount.get(), inputTypeStrategy)); currentPos += maxCount.get(); return this; }</code><technical_language>add a precondition check for ConstantArgumentCount</technical_language>

Target:
public SubSequenceStrategyBuilder subSequence(InputTypeStrategy inputTypeStrategy) { Preconditions.checkArgument(inputTypeStrategy.getArgumentCount() instanceof ConstantArgumentCount); Optional<Integer> maxCount = inputTypeStrategy.getArgumentCount().getMaxCount(); Optional<Integer> minCount = inputTypeStrategy.getArgumentCount().getMinCount(); if (!maxCount.isPresent() || !minCount.isPresent() || !maxCount.get().equals(minCount.get())) { throw new IllegalArgumentException("Both the minimum and maximum number of expected arguments must" + " be defined and equal to each other."); } argumentsSplits.add(new ArgumentsSplit(currentPos, currentPos + maxCount.get(), inputTypeStrategy)); currentPos += maxCount.get(); return this; }
Source:
<code><START> public void create(final EventTypeBase eventType) throws TopicCreationException, InternalNakadiException, <END> NoSuchPartitionStrategyException, DuplicatedEventTypeNameException, InvalidEventTypeException { if (featureToggleService.isFeatureEnabled(FeatureToggleService.Feature.DISABLE_DB_WRITE_OPERATIONS)) { throw new DbWriteOperationsBlockedException("Cannot create event type: write operations on DB " + "are blocked by feature flag."); } setDefaultEventTypeOptions(eventType); validateSchema(eventType); enrichment.validate(eventType); partitionResolver.validate(eventType); authorizationValidator.validateAuthorization(eventType.getAuthorization()); eventTypeRepository.saveEventType(eventType); try { timelineService.createDefaultTimeline(eventType.getName(), partitionsCalculator.getBestPartitionsCount(eventType.getDefaultStatistic()), eventType.getOptions().getRetentionTime()); } catch (final Exception e) { try { eventTypeRepository.removeEventType(eventType.getName()); } catch (final NoSuchEventTypeException e1) { LOG.error("Error creating event type {}", eventType, e1); } throw e; } nakadiKpiPublisher.publish(etLogEventType, () -> new JSONObject() .put("event_type", eventType.getName()) .put("status", "created") .put("category", eventType.getCategory()) .put("authz", identifyAuthzState(eventType)) .put("compatibility_mode", eventType.getCompatibilityMode())); }</code><technical_language>throws DbWriteOperationsBlockedException for other methods in class</technical_language>

Target:
public void create(final EventTypeBase eventType) throws TopicCreationException, InternalNakadiException, NoSuchPartitionStrategyException, DuplicatedEventTypeNameException, InvalidEventTypeException, DbWriteOperationsBlockedException { if (featureToggleService.isFeatureEnabled(FeatureToggleService.Feature.DISABLE_DB_WRITE_OPERATIONS)) { throw new DbWriteOperationsBlockedException("Cannot create event type: write operations on DB " + "are blocked by feature flag."); } setDefaultEventTypeOptions(eventType); validateSchema(eventType); enrichment.validate(eventType); partitionResolver.validate(eventType); authorizationValidator.validateAuthorization(eventType.getAuthorization()); eventTypeRepository.saveEventType(eventType); try { timelineService.createDefaultTimeline(eventType.getName(), partitionsCalculator.getBestPartitionsCount(eventType.getDefaultStatistic()), eventType.getOptions().getRetentionTime()); } catch (final Exception e) { try { eventTypeRepository.removeEventType(eventType.getName()); } catch (final NoSuchEventTypeException e1) { LOG.error("Error creating event type {}", eventType, e1); } throw e; } nakadiKpiPublisher.publish(etLogEventType, () -> new JSONObject() .put("event_type", eventType.getName()) .put("status", "created") .put("category", eventType.getCategory()) .put("authz", identifyAuthzState(eventType)) .put("compatibility_mode", eventType.getCompatibilityMode())); }
Source:
<code>public void updateFromItem(final InfoItem infoItem, final HistoryRecordManager historyRecordManager) { if (!(infoItem instanceof PlaylistInfoItem)) return; final PlaylistInfoItem item = (PlaylistInfoItem) infoItem; itemTitleView.setText(item.getName()); <START> itemStreamCountView.setText(Localization.localizeStreamCount(itemStreamCountView.getContext(), <END> item.getStreamCount())); itemUploaderView.setText(item.getUploaderName()); itemBuilder.getImageLoader() .displayImage(item.getThumbnailUrl(), itemThumbnailView, ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS); itemView.setOnClickListener(view -> { if (itemBuilder.getOnPlaylistSelectedListener() != null) { itemBuilder.getOnPlaylistSelectedListener().selected(item); } }); itemView.setLongClickable(true); itemView.setOnLongClickListener(view -> { if (itemBuilder.getOnPlaylistSelectedListener() != null) { itemBuilder.getOnPlaylistSelectedListener().held(item); } return true; }); }</code><technical_language>count in PR. e.g. "100+" instead of "100+ videos"</technical_language>

Target:
public void updateFromItem(final InfoItem infoItem, final HistoryRecordManager historyRecordManager) { if (!(infoItem instanceof PlaylistInfoItem)) { return; } final PlaylistInfoItem item = (PlaylistInfoItem) infoItem; itemTitleView.setText(item.getName()); itemStreamCountView.setText(Localization .localizeStreamCountMini(itemStreamCountView.getContext(), item.getStreamCount())); itemUploaderView.setText(item.getUploaderName()); itemBuilder.getImageLoader() .displayImage(item.getThumbnailUrl(), itemThumbnailView, ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS); itemView.setOnClickListener(view -> { if (itemBuilder.getOnPlaylistSelectedListener() != null) { itemBuilder.getOnPlaylistSelectedListener().selected(item); } }); itemView.setLongClickable(true); itemView.setOnLongClickListener(view -> { if (itemBuilder.getOnPlaylistSelectedListener() != null) { itemBuilder.getOnPlaylistSelectedListener().held(item); } return true; }); }
Source:
<code>protected void flush() throws Exception { TransactionHelper.commitOrRollbackTransaction(); TransactionHelper.startTransaction(); <START> Assert.assertTrue(Framework.getService(AuditLogger.class).await(5, TimeUnit.SECONDS)); <END> }</code><technical_language>static import for assertTrue please. AuditLogger injected instead of explicit Framework.getService lookup</technical_language>

Target:
protected void flush() throws Exception { txFeature.nextTransaction(); }
Source:
<code>public static Node create(int createdIndex, boolean dir, List<Node> nodes, String expiration, String key, int modifiedIndex, int ttl, String value) { if (nodes == null) <START> nodes = ImmutableList.of(); <END> return new AutoValue_Node(createdIndex, dir, ImmutableList.copyOf(nodes), expiration, key, modifiedIndex, ttl, value); }</code><technical_language>apply conditional inline passing parameter. avoid changing reference for input parameters</technical_language>

Target:
public static Node create(int createdIndex, boolean dir, List<Node> nodes, String expiration, String key, int modifiedIndex, int ttl, String value) { return new AutoValue_Node(createdIndex, dir, nodes != null ? ImmutableList.copyOf(nodes) : ImmutableList.<Node> of(), expiration, key, modifiedIndex, ttl, value); }
Source:
<code>public Map.Entry<K, V> map(ResultSet rs, StatementContext ctx) throws SQLException { <START> return ImmutableEntry.of(keyMapper.map(rs, ctx), valueMapper.map(rs, ctx)); <END> }</code><technical_language>consider AbstractMap.SimpleEntry remove need for ImmutableEntry class</technical_language>

Target:
public Map.Entry<K, V> map(ResultSet rs, StatementContext ctx) throws SQLException { return new AbstractMap.SimpleImmutableEntry<>(keyMapper.map(rs, ctx), valueMapper.map(rs, ctx)); }
Source:
<code>public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { AccessControlled _context = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); <START> if (_context != null && !_context.hasPermission(Computer.CONFIGURE)) { <END> return new ListBoxModel(); } return new StandardUsernameListBoxModel().withMatching(SSHAuthenticator.matcher(Connection.class), CredentialsProvider.lookupCredentials(StandardUsernameCredentials.class, context, ACL.SYSTEM, SSHLauncher.SSH_SCHEME)); }</code><technical_language>bug: this open a security hole: a direct call /descriptorById/hudson.plugins.sshslaves.SSHConnector/fillCredentialsIdItems a user Jenkins.READ permission (perhaps anonymous) enumerate credentials. I meant java if (_context == null || !_context.hasPermission(Computer.CONFIGURE)) {</technical_language>

Target:
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { AccessControlled _context = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); if (_context == null || !_context.hasPermission(Computer.CONFIGURE)) { return new ListBoxModel(); } return new StandardUsernameListBoxModel().withMatching(SSHAuthenticator.matcher(Connection.class), CredentialsProvider.lookupCredentials(StandardUsernameCredentials.class, context, ACL.SYSTEM, SSHLauncher.SSH_SCHEME)); }
Source:
<code>public AccessToken refreshAccessToken() throws IOException { if (refreshToken == null) { throw new IOException("UserCredentials instance cannot refresh because no refresh token was" <START> +" specified in constructor."); <END> } GenericData tokenRequest = new GenericData(); tokenRequest.set("client_id", clientId); tokenRequest.set("client_secret", clientSecret); tokenRequest.set("refresh_token", refreshToken); tokenRequest.set("grant_type", GRANT_TYPE); UrlEncodedContent content = new UrlEncodedContent(tokenRequest); HttpRequestFactory requestFactory = transport.createRequestFactory(); HttpRequest request = requestFactory.buildPostRequest(tokenServerUrl, content); request.setParser(new JsonObjectParser(OAuth2Utils.JSON_FACTORY)); HttpResponse response = request.execute(); GenericData responseData = response.parseAs(GenericData.class); String accessToken = OAuth2Utils.validateString(responseData, "access_token", PARSE_ERROR_PREFIX); int expiresInSeconds = OAuth2Utils.validateInt32(responseData, "expires_in", PARSE_ERROR_PREFIX); long expiresAtMilliseconds = clock.currentTimeMillis() + expiresInSeconds * 1000; AccessToken access = new AccessToken(accessToken, new Date(expiresAtMilliseconds)); return access; }</code><technical_language>add a space '+'. Also, want avoid referring coincidental details of implementation, fact currently, path providing refresh token is constructor; add other paths setting later</technical_language>

Target:
public AccessToken refreshAccessToken() throws IOException { if (refreshToken == null) { throw new IllegalStateException("UserCredentials instance cannot refresh because there is no" + " refresh token."); } GenericData tokenRequest = new GenericData(); tokenRequest.set("client_id", clientId); tokenRequest.set("client_secret", clientSecret); tokenRequest.set("refresh_token", refreshToken); tokenRequest.set("grant_type", GRANT_TYPE); UrlEncodedContent content = new UrlEncodedContent(tokenRequest); HttpRequestFactory requestFactory = transport.createRequestFactory(); HttpRequest request = requestFactory.buildPostRequest(tokenServerUrl, content); request.setParser(new JsonObjectParser(OAuth2Utils.JSON_FACTORY)); HttpResponse response = request.execute(); GenericData responseData = response.parseAs(GenericData.class); String accessToken = OAuth2Utils.validateString(responseData, "access_token", PARSE_ERROR_PREFIX); int expiresInSeconds = OAuth2Utils.validateInt32(responseData, "expires_in", PARSE_ERROR_PREFIX); long expiresAtMilliseconds = clock.currentTimeMillis() + expiresInSeconds * 1000; AccessToken access = new AccessToken(accessToken, new Date(expiresAtMilliseconds)); return access; }
Source:
<code>private void addAttributeField(Field attributeField, EntityProjectionBuilder projectionBuilder) { Class<?> parentType = projectionBuilder.getType(); String attributeName = attributeField.getName(); Class<?> attributeType = entityDictionary.getType(parentType, attributeName); if (attributeType != null) { Attribute matched = projectionBuilder.getAttributeByName(attributeName); if (matched == null) { Attribute attribute = Attribute.builder() .type(attributeType) <START> .name(attributeName) <END> .arguments( attributeField.getArguments().stream() .map(graphQLArgument -> com.yahoo.elide.request.Argument.builder() .name(graphQLArgument.getName()) .value( variableResolver.resolveValue( graphQLArgument.getValue())) .build()) .collect(Collectors.toList())) .build(); projectionBuilder.attribute(attribute); } else { if (matched.getArguments().isEmpty() && matched.getArguments() == Collections.EMPTY_SET) { matched.setArguments(new HashSet<>()); } attributeField.getArguments().forEach( graphQLArgument -> matched.getArguments().add( com.yahoo.elide.request.Argument.builder() .name(graphQLArgument.getName()) .value(variableResolver.resolveValue(graphQLArgument.getValue())) .build())); } } else { throw new InvalidEntityBodyException( String.format( "Unknown attribute field {%s.%s}.", entityDictionary.getJsonAliasFor(projectionBuilder.getType()), attributeName)); } }</code><technical_language>need set attribute aliases well</technical_language>

Target:
private void addAttributeField(Field attributeField, EntityProjectionBuilder projectionBuilder) { Class<?> parentType = projectionBuilder.getType(); String attributeName = attributeField.getName(); String attributeAlias = attributeField.getAlias() == null ? attributeName : attributeField.getAlias(); Class<?> attributeType = entityDictionary.getType(parentType, attributeName); if (attributeType != null) { Attribute attribute = Attribute.builder() .type(attributeType) .name(attributeName) .alias(attributeAlias) .arguments( attributeField.getArguments().stream() .map(graphQLArgument -> com.yahoo.elide.request.Argument.builder() .name(graphQLArgument.getName()) .value( variableResolver.resolveValue( graphQLArgument.getValue())) .build()) .collect(Collectors.toList())) .build(); projectionBuilder.attribute(attribute); } else { throw new InvalidEntityBodyException(String.format( "Unknown attribute field {%s.%s}.", entityDictionary.getJsonAliasFor(projectionBuilder.getType()), attributeName)); } }
Source:
<code><START> private String decode(final byte[] payload) { <END> if (payload == null) { return ""; } final int length = Math.min(payload.length, 1024); return new String(payload, 0, length, UTF_8); }</code><technical_language>this method is called in this class</technical_language>

Target:
private static String decode(final byte[] payload) { if (payload == null) { return ""; } final int length = Math.min(payload.length, 1024); return new String(payload, 0, length, UTF_8); }
Source:
<code>public void testMultiLevelMergeCombineTask() throws Exception { final int keyCnt = 100000; final int valCnt = 8; addInput(new UniformRecordGenerator(keyCnt, valCnt, false)); addInputComparator(this.comparator); setOutput(this.outList); getTaskConfig().setDriverStrategy(DriverStrategy.PARTIAL_GROUP); getTaskConfig().setMemoryDriver(COMBINE_MEM); getTaskConfig().setFilehandlesDriver(2); final CombineDriver<Record> testTask = new CombineDriver<Record>(); <START> testDriver(testTask, MockCombiningReduceStub.class); <END> int expSum = 0; for (int i = 1;i < valCnt; i++) { expSum += i; } final HashMap<IntValue, IntValue> aggMap = new HashMap<IntValue, IntValue>(); for (Record record : this.outList) { IntValue key = new IntValue(); IntValue value = new IntValue(); key = record.getField(0, key); value = record.getField(1, value); IntValue prevVal = aggMap.get(key); if (prevVal != null) { aggMap.put(key, new IntValue(prevVal.getValue() + value.getValue())); } else { aggMap.put(key, value); } } Assert.assertTrue("Resultset size was "+aggMap.size()+". Expected was "+keyCnt, aggMap.size() == keyCnt); for (IntValue integer : aggMap.values()) { Assert.assertTrue("Incorrect result", integer.getValue() == expSum); } this.outList.clear(); }</code><technical_language>test fail if exception</technical_language>

Target:
public void testMultiLevelMergeCombineTask() throws Exception { final int keyCnt = 100000; final int valCnt = 8; addInput(new UniformRecordGenerator(keyCnt, valCnt, false)); addInputComparator(this.comparator); setOutput(this.outList); getTaskConfig().setDriverStrategy(DriverStrategy.PARTIAL_GROUP); getTaskConfig().setMemoryDriver(COMBINE_MEM); getTaskConfig().setFilehandlesDriver(2); final CombineDriver<Record> testTask = new CombineDriver<Record>(); try { testDriver(testTask, MockCombiningReduceStub.class); } catch (Exception e) { e.printStackTrace(); Assert.fail("Invoke method caused exception."); } int expSum = 0; for (int i = 1;i < valCnt; i++) { expSum += i; } final HashMap<IntValue, IntValue> aggMap = new HashMap<IntValue, IntValue>(); for (Record record : this.outList) { IntValue key = new IntValue(); IntValue value = new IntValue(); key = record.getField(0, key); value = record.getField(1, value); IntValue prevVal = aggMap.get(key); if (prevVal != null) { aggMap.put(key, new IntValue(prevVal.getValue() + value.getValue())); } else { aggMap.put(key, value); } } Assert.assertTrue("Resultset size was "+aggMap.size()+". Expected was "+keyCnt, aggMap.size() == keyCnt); for (IntValue integer : aggMap.values()) { Assert.assertTrue("Incorrect result", integer.getValue() == expSum); } this.outList.clear(); }
Source:
<code><START> protected Measurement[] getModelMeasurementsImpl() { <END> return null; }</code><technical_language>this in OzaBag? @Override protected Measurement[] getModelMeasurementsImpl() { return new Measurement[]{new Measurement("ensemble size", this.ensemble != null ? this.ensemble.length : 0)}; } @Override public Classifier[] getSubClassifiers() { return this.ensemble.clone(); }</technical_language>

Target:
protected Measurement[] getModelMeasurementsImpl() { return new Measurement[]{new Measurement("ensemble size", this.ensemble != null ? this.ensemble.length : 0)}; }
Source:
<code>private static List<String> loadEndpoints(JsonNode node) { Preconditions.checkNotNull(node, "Must have endpoints node"); Preconditions.checkArgument(node.isArray(), "Endpoints config should be an array"); final List<String> list <START> = new ArrayList<>(node.size()); <END> node.elements().forEachRemaining(endpoint -> { list.add(endpoint.asText()); }); return list; }</code><technical_language>While ArrayList fail dramatically HashMap concurrency, ImmutableList more sense here</technical_language>

Target:
private static List<String> loadEndpoints(JsonNode node) { Preconditions.checkNotNull(node, "Must have endpoints node"); Preconditions.checkArgument(node.isArray(), "Endpoints config should be an array"); return Streams.stream(node.elements()) .map(endpoint -> endpoint.asText()) .collect(ImmutableList.toImmutableList()); }
Source:
<code>public void getSystemInformation_shouldAddAllLoadedModulesInformation() { Module module = new Module("name", "moduleId", "packageName", "author", "description", "version"); ModuleFactory.loadModule(module, false); int numberOfModules = ModuleFactory.getLoadedModules().size(); Map<String, Map<String, String>> systemInfoMap = Context.getAdministrationService().getSystemInformation(); <START> assertEquals(numberOfModules + 1, systemInfoMap.get("SystemInfo.title.moduleInformation").size()); <END> }</code><technical_language>assert module loaded is in there. moment assert number matches expect number loaded module. check that</technical_language>

Target:
public void getSystemInformation_shouldAddAllLoadedModulesInformation() { int numberOfModulesOld = ModuleFactory.getLoadedModules().size(); Module module = new Module("name", "moduleId", "packageName", "author", "description", "version"); ModuleFactory.loadModule(module, false); int numberOfModulesNew = ModuleFactory.getLoadedModules().size(); Map<String, Map<String, String>> systemInfoMap = adminService.getSystemInformation(); assertEquals(numberOfModulesNew, numberOfModulesOld + 1); assertEquals(numberOfModulesNew + 1, systemInfoMap.get("SystemInfo.title.moduleInformation").size()); }
Source:
<code>public Poller(Duration pollInterval, Function<PollResponse<T>, Mono<PollResponse<T>>> pollOperation, Consumer<Poller<T>> cancelOperation) { if (pollInterval == null || pollInterval.toNanos() <= 0) { <START> throw logger.logExceptionAsWarning(new IllegalArgumentException("Null, negative or zero value for poll " <END> + "interval is not allowed.")); } if (pollOperation == null) { throw logger.logExceptionAsWarning(new IllegalArgumentException("Null value for poll operation is not " + "allowed.")); } this.pollInterval = pollInterval; this.pollOperation = pollOperation; this.pollResponse = new PollResponse<>(OperationStatus.NOT_STARTED, null); this.fluxHandle = asyncPollRequestWithDelay() .flux() .repeat() .takeUntil(pollResponse -> hasCompleted()) .share(); this.fluxDisposable = fluxHandle.subscribe(); this.autoPollingEnabled = true; this.cancelOperation = cancelOperation; }</code><technical_language>put entire string next line split it</technical_language>

Target:
public Poller(Duration pollInterval, Function<PollResponse<T>, Mono<PollResponse<T>>> pollOperation, Consumer<Poller<T>> cancelOperation) { if (pollInterval == null || pollInterval.toNanos() <= 0) { throw logger.logExceptionAsWarning(new IllegalArgumentException( "Null, negative or zero value for poll interval is not allowed.")); } if (pollOperation == null) { throw logger.logExceptionAsWarning(new IllegalArgumentException( "Null value for poll operation is not allowed.")); } this.pollInterval = pollInterval; this.pollOperation = pollOperation; this.pollResponse = new PollResponse<>(OperationStatus.NOT_STARTED, null); this.fluxHandle = asyncPollRequestWithDelay() .flux() .repeat() .takeUntil(pollResponse -> hasCompleted()) .share(); this.fluxDisposable = fluxHandle.subscribe(); this.autoPollingEnabled = true; this.cancelOperation = cancelOperation; }
Source:
<code>public void testList() throws GitLabApiException { Snippet snippet1 = createSnippet(new Snippet("Snippet 1", "Snippet.java", "Java content")); Snippet snippet2 = createSnippet(new Snippet("Snippet 2", "Snippet.java", "Another java content")); SnippetsApi api = gitLabApi.getSnippetApi(); List<Snippet> snippets = api.getSnippets(); assertTrue(snippets.size() >= 2); assertTrue(snippets.stream().anyMatch(s -> s.getContent().equals("Java content"))); <START> assertTrue(snippets.stream().anyMatch(s -> s.getContent().equals("Another java content"))); <END> deleteSnippet(snippet1); deleteSnippet(snippet2); }</code><technical_language>comparing strings in unit tests is a good idea constants, is do assert below</technical_language>

Target:
public void testList() throws GitLabApiException { Snippet snippet1 = createSnippet(new Snippet(TEST_SNIPPET_TITLE_1, TEST_SNIPPET_FILE_NAME_1, TEST_SNIPPET_CONTENT_1)); Snippet snippet2 = createSnippet(new Snippet(TEST_SNIPPET_TITLE_1, TEST_SNIPPET_FILE_NAME_1, TEST_SNIPPET_CONTENT_2)); SnippetsApi api = gitLabApi.getSnippetApi(); List<Snippet> snippets = api.getSnippets(true); assertTrue(snippets.size() >= 2); assertTrue(snippets.stream().anyMatch(s -> s.getContent().equals(TEST_SNIPPET_CONTENT_1))); assertTrue(snippets.stream().anyMatch(s -> s.getContent().equals(TEST_SNIPPET_CONTENT_2))); deleteSnippet(snippet1); deleteSnippet(snippet2); }