auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected View onCreateAnswerView(Context context, FormEntryPrompt prompt, int answerFontSize) { binding = WidgetAnswerBinding.inflate(((Activity) context).getLayoutInflater()); <START> View answerView = binding.getRoot(); <END> datePickerDetails = DateTimeUtils.getDatePickerDetails(prompt.getQuestion().getAppearanceAttr()); if (prompt.isReadOnly()) { binding.widgetButton.setVisibility(GONE); } else { binding.widgetButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); binding.widgetButton.setText(getContext().getString(R.string.select_date)); binding.widgetButton.setOnClickListener(v -> onButtonClick(binding.widgetButton.getId())); } binding.widgetAnswerText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); if (getFormEntryPrompt().getAnswerValue() == null) { clearAnswer(); } else { date = new LocalDateTime(getFormEntryPrompt().getAnswerValue().getValue()); isNullAnswer = false; DateTimeWidgetUtils.setDateLabel(getContext(), binding.widgetAnswerText, (Date) getAnswer().getValue(), datePickerDetails); } return answerView; }</code><technical_language>this variable in return, get rid of return binding.getRoot()</technical_language>

Target:
protected View onCreateAnswerView(Context context, FormEntryPrompt prompt, int answerFontSize) { binding = DateWidgetAnswerBinding.inflate(((Activity) context).getLayoutInflater()); datePickerDetails = DateTimeWidgetUtils.getDatePickerDetails(prompt.getQuestion().getAppearanceAttr()); if (prompt.isReadOnly()) { binding.dateButton.setVisibility(GONE); } else { binding.dateButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); binding.dateButton.setOnClickListener(v -> { DateTimeWidgetUtils.setWidgetWaitingForData(prompt.getIndex()); widgetUtils.showDatePickerDialog(context, datePickerDetails, selectedDate); }); } binding.dateAnswerText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); if (prompt.getAnswerValue() == null) { selectedDate = DateTimeUtils.getCurrentDateTime(); } else { selectedDate = DateTimeUtils.getSelectedDate(new LocalDateTime(getFormEntryPrompt().getAnswerValue().getValue()), LocalDateTime.now()); binding.dateAnswerText.setText(DateTimeWidgetUtils.getDateTimeLabel(selectedDate.toDate(), datePickerDetails, false, context)); } return binding.getRoot(); }
Source:
<code>public void delete(String key) { File file = new File(getMapStorePath() + key + PERSISTED_FILE_SUFFIX); if (file.exists()) { try { Files.delete(file.toPath()); } catch (IOException e) { <START> LOGGER.debug("File was unable to be deleted: {}", file.getAbsolutePath()); <END> } } }</code><technical_language>Is this a problem restart? log higher debug</technical_language>

Target:
public void delete(String key) { File file = new File(getPersistedFilePathForKey(key)); if (file.exists()) { try { Files.delete(file.toPath()); } catch (IOException e) { LOGGER.debug("File was unable to be deleted: {}", file.getAbsolutePath(), e); LOGGER.warn( "Unable to remove file [{}]. Turn logging to debug for more info.", file.getAbsolutePath()); } } }
Source:
<code>public void testSizeAfterClearInBranchedTransaction() throws Exception { cache.put(1, "v1"); tm().begin(); try { assertEquals("v1", cache.get(1)); Transaction suspended = tm().suspend(); tm().begin(); try { cache.clear(); } finally { tm().commit(); tm().resume(suspended); assertEquals(1, cache.size()); assertEquals("v1", cache.get(1)); } } finally { <START> safeCommit(); <END> } }</code><technical_language>tests safe... if commit fails, safeCommit() try commit transaction again, instead of resuming committing transaction</technical_language>

Target:
public void testSizeAfterClearInBranchedTransaction() throws Exception { cache.put(1, "v1"); tm().begin(); assertEquals("v1", cache.get(1)); cache.clear(); assertEquals(1, cache.size()); assertEquals("v1", cache.get(1)); safeCommit(false); }
Source:
<code>public @Nullable QuantityType<T> toUnit(Unit<?> targetUnit) { if (!targetUnit.equals(getUnit())) { try { UnitConverter uc = getUnit().getConverterToAny(targetUnit); Quantity<?> result = Quantities.getQuantity(uc.convert(quantity.getValue()), targetUnit); return new QuantityType<T>(result.getValue().doubleValue(), (Unit<T>) targetUnit, conversionUnits); } catch (UnconvertibleException | IncommensurableException e) { logger.debug("Unable to convert unit from to {}", <START> new Object[] { getUnit().toString(), targetUnit.toString() }); <END> return null; } } return this; }</code><technical_language>replace getUnit(), targetUnit</technical_language>

Target:
public @Nullable QuantityType<T> toUnit(Unit<?> targetUnit) { if (!targetUnit.equals(getUnit())) { try { UnitConverter uc = getUnit().getConverterToAny(targetUnit); Quantity<?> result = Quantities.getQuantity(uc.convert(quantity.getValue()), targetUnit); return new QuantityType<T>(result.getValue(), (Unit<T>) targetUnit); } catch (UnconvertibleException | IncommensurableException e) { logger.debug("Unable to convert unit from to {}", getUnit(), targetUnit); return null; } } return this; }
Source:
<code>protected CommandBase(T parameters, CommandContext cmdContext) { <START> log.error("int CommandBase"); <END> if (cmdContext == null) { cmdContext = new CommandContext(new EngineContext().withSessionId(parameters.getSessionId())) .withExecutionContext(new ExecutionContext()); } else if (cmdContext.getEngineContext().getSessionId() == null) { cmdContext.getEngineContext().withSessionId(parameters.getSessionId()); } this.context = cmdContext; _parameters = parameters; Guid commandIdFromParameters = parameters.getCommandId(); if (commandIdFromParameters == null) { commandIdFromParameters = Guid.newGuid(); getParameters().setCommandId(commandIdFromParameters); } commandId = commandIdFromParameters; taskHandlers = initTaskHandlers(); log.error("out CommandBase"); }</code><technical_language>remove</technical_language>

Target:
protected CommandBase(T parameters, CommandContext cmdContext) { if (cmdContext == null) { cmdContext = new CommandContext(new EngineContext().withSessionId(parameters.getSessionId())) .withExecutionContext(new ExecutionContext()); } else if (cmdContext.getEngineContext().getSessionId() == null) { cmdContext.getEngineContext().withSessionId(parameters.getSessionId()); } this.context = cmdContext; _parameters = parameters; Guid commandIdFromParameters = parameters.getCommandId(); if (commandIdFromParameters == null) { commandIdFromParameters = Guid.newGuid(); getParameters().setCommandId(commandIdFromParameters); } commandId = commandIdFromParameters; taskHandlers = initTaskHandlers(); }
Source:
<code>protected static void setUp(String transport) { testApplicationBootstrap = new TestApplicationBootstrap(); singleNodeApplication = testApplicationBootstrap.getSingleNodeApplication().run("--transport", transport); integrationSupport = new SingleNodeIntegrationTestSupport(singleNodeApplication); if (testMessageBus != null && !transport.equalsIgnoreCase("local")) { TestMessageBusInjection.injectMessageBus(singleNodeApplication, testMessageBus); } <START> ContainerAttributes cm = singleNodeApplication.containerContext().getBean(ContainerAttributes.class); <END> integrationSupport.addPathListener(Paths.build(Paths.MODULE_DEPLOYMENTS, cm.getId()), deploymentsListener); }</code><technical_language>more nitpicky, change "cm" "attribs"</technical_language>

Target:
protected static void setUp(String transport) { testApplicationBootstrap = new TestApplicationBootstrap(); singleNodeApplication = testApplicationBootstrap.getSingleNodeApplication().run("--transport", transport); integrationSupport = new SingleNodeIntegrationTestSupport(singleNodeApplication); if (testMessageBus != null && !transport.equalsIgnoreCase("local")) { TestMessageBusInjection.injectMessageBus(singleNodeApplication, testMessageBus); } ContainerAttributes attribs = singleNodeApplication.containerContext().getBean(ContainerAttributes.class); integrationSupport.addPathListener(Paths.build(Paths.MODULE_DEPLOYMENTS, attribs.getId()), deploymentsListener); }
Source:
<code><START> private void findDir() { <END> List<Path> candidates = Arrays.asList( Paths.get(configService.getMPConfig().getSecretDir()), Paths.get(System.getProperty("com.sun.aas.instanceRoot"), configService.getMPConfig().getSecretDir()) ); for (Path candidate : candidates) { if (Files.exists(candidate) || Files.isDirectory(candidate) || Files.isReadable(candidate)) { this.directory = candidate; return; } } }</code><technical_language>return dir instead of initialising field this method independent of class. a method a static method accepts a Config (from MPConfig) returning dir passed constructor argument initialise this class. This allows this class directory coming MP config other source. testing another candidate this parameter. moving watcher part out of constructor a method is called constructing instance passing in executor service. java void updateUsingFileWatcher(PayaraExecutorService executorService) { //... executorService.submit(new DirPropertyWatcher(this.directory)); //... } This allow trigger this in tests while creating list of config sources</technical_language>

Target:
private Path findDir() throws IOException { String path = configService.getMPConfig().getSecretDir(); List<Path> candidates = Arrays.asList( Paths.get(path), Paths.get(System.getProperty("com.sun.aas.instanceRoot"), path) ); for (Path candidate : candidates) { if (Files.exists(candidate) || Files.isDirectory(candidate) || Files.isReadable(candidate)) { return candidate; } } throw new IOException("Given MPCONFIG directory '"+path+"' is no directory or cannot be read."); }
Source:
<code>public void validateAllProvidedTransactionsExists(final List<TransactionDto> transactionDtos, final Set<Integer> transactionIds) { errors = new MapBindingResult(new HashMap<String, String>(), TransactionDto.class.getName()); if (transactionIds != null && !transactionIds.isEmpty() && transactionIds.size() != transactionDtos.size()) { <START> errors.reject("transactions.does.not.exist", ""); <END> throw new ApiRequestValidationException(errors.getAllErrors()); } }</code><technical_language>@cuenyad include information valid ids, please check TransactionUpdateRequestDtoValidator, line 71. standards</technical_language>

Target:
public void validateAllProvidedTransactionsExists(final List<TransactionDto> transactionDtos, final Set<Integer> transactionIds) { errors = new MapBindingResult(new HashMap<String, String>(), TransactionDto.class.getName()); if (transactionDtos.size() != transactionIds.size()) { final List<Integer> existentTransactionIds = transactionDtos.stream().map(TransactionDto::getTransactionId).collect(Collectors.toList()); final List<Integer> invalidTransactionIds = new ArrayList<>(transactionIds); invalidTransactionIds.removeAll(existentTransactionIds); errors.reject("transactions.not.found", new String[] {Util.buildErrorMessageFromList(invalidTransactionIds, 3)}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); } }
Source:
<code>public synchronized void start() throws AppiumServerHasNotBeenStartedLocallyException { if (isRunning()) return; try { process = new CommandLine(this.nodeJSExec.getCanonicalPath(), nodeJSArgs.toArray(new String[] {})); process.setEnvironmentVariables(nodeJSEnvironment); process.copyOutputTo(System.err); process.executeAsync(); ping(timeToWaitForServerIsStarted, timeUnitToWaitForServerIsStarted); } catch (UrlChecker.TimeoutException e) { destroyProcess(); String msgTxt = "The node hasn't been run! Arguments: " + nodeJSArgs.toString() + " " + "\n"; String processStream = process.getStdOut(); if (!StringUtils.isBlank(processStream)) msgTxt = msgTxt + "Process output: " + processStream + "\n"; throw new AppiumServerHasNotBeenStartedLocallyException(msgTxt, e); } catch (Throwable e){ destroyProcess(); <START> throw new AppiumServerHasNotBeenStartedLocallyException("An unexpected throwable has been caught!", <END> e); } }</code><technical_language>Do more concise this? java throw new ServerNotStartedException("The local appium server started."); message unexpected throwable caught! useful end user</technical_language>

Target:
public synchronized void start() throws AppiumServerHasNotBeenStartedLocallyException { if (isRunning()) return; try { process = new CommandLine(this.nodeJSExec.getCanonicalPath(), nodeJSArgs.toArray(new String[] {})); process.setEnvironmentVariables(nodeJSEnvironment); process.copyOutputTo(System.err); process.executeAsync(); ping(startupTimeout, timeUnit); } catch (Throwable e) { destroyProcess(); String msgTxt = "The local appium server has not been started. " + "The given Node.js executable: " + this.nodeJSExec.getAbsolutePath() + " Arguments: " + nodeJSArgs.toString() + " " + "\n"; String processStream = process.getStdOut(); if (!StringUtils.isBlank(processStream)) msgTxt = msgTxt + "Process output: " + processStream + "\n"; throw new AppiumServerHasNotBeenStartedLocallyException(msgTxt, e); } }
Source:
<code>private void addOrUpdateSnapshotsConfig(Guid clusterId, GlusterSnapshotConfigInfo configInfo) { acquireLock(clusterId); <START> try { <END> for (Map.Entry<String, String> entry : configInfo.getClusterConfigOptions().entrySet()) { if (entry.getValue() != null) { addOrUpdateClusterConfig(clusterId, entry.getKey(), entry.getValue()); } } } finally { releaseLock(clusterId); } Map<String, Map<String, String>> volumeConfigs = configInfo.getVolumeConfigOptions(); for (Map.Entry<String, Map<String, String>> entry : volumeConfigs.entrySet()) { GlusterVolumeEntity volume = getGlusterVolumeDao().getByName(clusterId, entry.getKey()); if (volume == null) { continue; } acquireLock(volume.getId()); try { Map<String, String> volumeConfig = entry.getValue(); if (volumeConfig != null) { for (Map.Entry<String, String> entry1 : volumeConfig.entrySet()) { if (entry.getValue() != null) { addOrUpdateVolumeConfig(clusterId, volume.getId(), entry1.getKey(), entry1.getValue()); } } } } finally { releaseLock(volume.getId()); } } }</code><technical_language>try with</technical_language>

Target:
private void addOrUpdateSnapshotsConfig(Guid clusterId, GlusterSnapshotConfigInfo configInfo) { try (EngineLock lock = acquireVolumeSnapshotLock(clusterId)) { for (Map.Entry<String, String> entry : configInfo.getClusterConfigOptions().entrySet()) { if (entry.getValue() != null) { addOrUpdateClusterConfig(clusterId, entry.getKey(), entry.getValue()); } } } catch (Exception e) { log.error("Exception ocuured while adding/updating snapshots configurations from CLI - '{}'", e.getMessage()); log.debug("Exception", e); throw new VdcBLLException(VdcBllErrors.GlusterSnapshotInfoFailedException, e.getLocalizedMessage()); } Map<String, Map<String, String>> volumeConfigs = configInfo.getVolumeConfigOptions(); for (Map.Entry<String, Map<String, String>> entry : volumeConfigs.entrySet()) { GlusterVolumeEntity volume = getGlusterVolumeDao().getByName(clusterId, entry.getKey()); if (volume == null) { continue; } try (EngineLock lock = acquireVolumeSnapshotLock(volume.getId())) { Map<String, String> volumeConfig = entry.getValue(); if (volumeConfig != null) { for (Map.Entry<String, String> entry1 : volumeConfig.entrySet()) { if (entry.getValue() != null) { addOrUpdateVolumeConfig(clusterId, volume.getId(), entry1.getKey(), entry1.getValue()); } } } } catch (Exception e) { log.error("Exception ocuured while adding/updating snapshots configurations from CLI - '{}'", e.getMessage()); log.debug("Exception", e); throw new VdcBLLException(VdcBllErrors.GlusterSnapshotInfoFailedException, e.getLocalizedMessage()); } } }
Source:
<code>public RequestDispatcher(StaticResolver staticResolver, Debugger debugger) { this.staticResolver = staticResolver; this.debugger = debugger; <START> filters = new ArrayList<>(Arrays.asList(new CsrfFilter())); <END> }</code><technical_language>need convert List ArrayList, Arrays.asList enough here</technical_language>

Target:
public RequestDispatcher(StaticResolver staticResolver, Debugger debugger) { this.staticResolver = staticResolver; this.debugger = debugger; this.filters = ImmutableList.of(new CsrfFilter()); }
Source:
<code>public static JSONObject addForwardOptionalReverse(Collection col) { String name = "Basic (optional reversed card)"; Models mm = col.getModels(); JSONObject m = newBasicModel(col); try { m.put("name", name); JSONObject fm = mm.newField("Add Reverse"); mm.addFieldInNewModel(m, fm); JSONObject t = mm.newTemplate("Card 2"); t.put("qfmt", "{{#Add Reverse}}{{Back}}{{/Add Reverse}}"); t.put("afmt", "{{FrontSide}}\n\n<hr id=answer>\n\n{{Front}}"); mm.addTemplateInNewModel(m, t); <START> mm.add(m); <END> } catch (JSONException e) { throw new RuntimeException(e); } return m; }</code><technical_language>Tab... lol</technical_language>

Target:
public static JSONObject addForwardOptionalReverse(Collection col) { String name = "Basic (optional reversed card)"; Models mm = col.getModels(); JSONObject m = _newBasicModel(col); try { m.put("name", name); JSONObject fm = mm.newField("Add Reverse"); mm.addFieldInNewModel(m, fm); JSONObject t = mm.newTemplate("Card 2"); t.put("qfmt", "{{#Add Reverse}}{{Back}}{{/Add Reverse}}"); t.put("afmt", "{{FrontSide}}\n\n<hr id=answer>\n\n{{Front}}"); mm.addTemplateInNewModel(m, t); mm.add(m); } catch (JSONException e) { throw new RuntimeException(e); } return m; }
Source:
<code>public void execute(final Object message) throws Exception { final int timeLimit = timeLimit(verb); final UntypedActorContext context = getContext(); context.setReceiveTimeout(Duration.create(timeLimit, TimeUnit.SECONDS)); if (dialRecordAttribute != null && "true".equalsIgnoreCase(dialRecordAttribute.value())) { if(logger.isInfoEnabled()) { logger.info("Start recording of the bridge"); } record(bridge); } <START> if(enable200OkDelay){ <END> call.tell(message, self()); } }</code><technical_language>@kacmos thought this LCM is working enable200OKDelay == false, checked if LCM work feature true? I LCM wont work enable200OKDelay == true. need find a protect LCM</technical_language>

Target:
public void execute(final Object message) throws Exception { final int timeLimit = timeLimit(verb); final UntypedActorContext context = getContext(); context.setReceiveTimeout(Duration.create(timeLimit, TimeUnit.SECONDS)); if (dialRecordAttribute != null && "true".equalsIgnoreCase(dialRecordAttribute.value())) { if(logger.isInfoEnabled()) { logger.info("Start recording of the bridge"); } record(bridge); } if(enable200OkDelay && verb !=null && Verbs.dial.equals(verb.name())){ call.tell(message, self()); } }
Source:
<code>public ClusterConditionFieldAutoCompleter() { mVerbs.add(NAME); mVerbs.add(DESCRIPTION); <START> mVerbs.add("COMMENT"); <END> mVerbs.add("ARCHITECTURE"); buildCompletions(); getTypeDictionary().put(NAME, String.class); getTypeDictionary().put(DESCRIPTION, String.class); getTypeDictionary().put("COMMENT", String.class); getTypeDictionary().put("ARCHITECTURE", ArchitectureType.class); columnNameDict.put(NAME, "name"); columnNameDict.put(DESCRIPTION, "description"); columnNameDict.put("COMMENT", "free_text_comment"); columnNameDict.put("ARCHITECTURE", "architecture"); buildBasicValidationTable(); }</code><technical_language>moving constants</technical_language>

Target:
public ClusterConditionFieldAutoCompleter() { mVerbs.add(NAME); mVerbs.add(DESCRIPTION); mVerbs.add(COMMENT); mVerbs.add(ARCHITECTURE); buildCompletions(); getTypeDictionary().put(NAME, String.class); getTypeDictionary().put(DESCRIPTION, String.class); getTypeDictionary().put(COMMENT, String.class); getTypeDictionary().put(ARCHITECTURE, ArchitectureType.class); columnNameDict.put(NAME, "name"); columnNameDict.put(DESCRIPTION, "description"); columnNameDict.put(COMMENT, "free_text_comment"); columnNameDict.put(ARCHITECTURE, "architecture"); buildBasicValidationTable(); }
Source:
<code>public static StructuredRecord.Builder cloneRecord(StructuredRecord record, Schema outputSchema, String predictionField) { List<Schema.Field> fields = new ArrayList<>(); <START> fields.addAll(outputSchema.getFields()); <END> fields.add(Schema.Field.of(predictionField, Schema.of(Schema.Type.DOUBLE))); outputSchema = Schema.recordOf("records", fields); StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); for (Schema.Field field : outputSchema.getFields()) { if (!predictionField.equals(field.getName())) { builder.set(field.getName(), record.get(field.getName())); } } return builder; }</code><technical_language>combine lines one. java List<Schema.Field> fields = new ArrayList<>(outputSchema.getFields());</technical_language>

Target:
static StructuredRecord.Builder cloneRecord(StructuredRecord record, Schema outputSchema, String predictionField) { List<Schema.Field> fields = new ArrayList<>(outputSchema.getFields()); fields.add(Schema.Field.of(predictionField, Schema.of(Schema.Type.DOUBLE))); outputSchema = Schema.recordOf("records", fields); StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); for (Schema.Field field : outputSchema.getFields()) { if (!predictionField.equals(field.getName())) { builder.set(field.getName(), record.get(field.getName())); } } return builder; }
Source:
<code>private void handleStateChange(ConnectionState newState) { switch ( newState ) { case SUSPENDED: publishEvent(TreeCacheEvent.Type.CONNECTION_SUSPENDED); break; <START> case LOST: <END> isInitialized.set(false); publishEvent(TreeCacheEvent.Type.CONNECTION_LOST); break; case CONNECTED: try { root.wasCreated(); } catch ( Exception e ) { handleException(e); } break; case RECONNECTED: try { root.wasReconnected(); publishEvent(TreeCacheEvent.Type.CONNECTION_RECONNECTED); } catch ( Exception e ) { handleException(e); } break; } }</code><technical_language>LOST session lost. means retry policy up. Is this intent</technical_language>

Target:
private void handleStateChange(ConnectionState newState) { switch ( newState ) { case SUSPENDED: publishEvent(TreeCacheEvent.Type.CONNECTION_SUSPENDED); break; case LOST: isInitialized.set(false); publishEvent(TreeCacheEvent.Type.CONNECTION_LOST); break; case CONNECTED: try { root.wasCreated(); } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); handleException(e); } break; case RECONNECTED: try { root.wasReconnected(); publishEvent(TreeCacheEvent.Type.CONNECTION_RECONNECTED); } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); handleException(e); } break; } }
Source:
<code>static boolean enqueueExitBlock4() { try { throwSpecificException(); } catch (Throwable e) { <START> return true; <END> } return true; }</code><technical_language>if more interesting false correctly jumping catch</technical_language>

Target:
static boolean enqueueExitBlock4() { try { throwSpecificException(); } catch (Throwable e) { return true; } return false; }
Source:
<code>public void testGoodSubjectNonAmqp() throws SecurityServiceException { <START> securityServerPlugin.clearCache(); <END> Message message = new CoreMessage(); message.setAddress("test.address"); securityServerPlugin.handleMessage(mockServerSession, null, message, false, false); assertThat(message.getStringProperty("subject"), is("Hello World")); }</code><technical_language>put this in @Before method</technical_language>

Target:
public void testGoodSubjectNonAmqp() throws SecurityServiceException { Message message = new CoreMessage(); message.setAddress("test.address"); securityServerPlugin.handleMessage(mockServerSession, null, message, false, false); assertThat(message.getStringProperty("subject"), is("Hello World")); }
Source:
<code>protected void testMultiMapPutAllSetup() { MultiMapConfig multiMapConfig1 = new MultiMapConfig() .setName("testMultiMapList") .setValueCollectionType(MultiMapConfig.ValueCollectionType.LIST) .setBinary(false); MultiMapConfig multiMapConfig2 = new MultiMapConfig() .setName("testMultiMapSet") .setValueCollectionType(MultiMapConfig.ValueCollectionType.SET) .setBinary(false); MultiMapConfig multiMapConfig3 = new MultiMapConfig() <START> .setName("expectedMultiMap1") <END> .setValueCollectionType(MultiMapConfig.ValueCollectionType.LIST) .setBinary(false); client.getConfig() .addMultiMapConfig(multiMapConfig1) .addMultiMapConfig(multiMapConfig2) .addMultiMapConfig(multiMapConfig3); }</code><technical_language>is this configuration is for ? remove if is redundant</technical_language>

Target:
protected void testMultiMapPutAllSetup() { MultiMapConfig multiMapConfig1 = new MultiMapConfig() .setName("testMultiMapList") .setValueCollectionType(MultiMapConfig.ValueCollectionType.LIST) .setBinary(false); MultiMapConfig multiMapConfig2 = new MultiMapConfig() .setName("testMultiMapSet") .setValueCollectionType(MultiMapConfig.ValueCollectionType.SET) .setBinary(false); client.getConfig() .addMultiMapConfig(multiMapConfig1) .addMultiMapConfig(multiMapConfig2); }
Source:
<code>public GoGoDuck(String geoserverUrl, String profile, String subset, String outputFile, Integer limit) { this(profile, subset, outputFile, limit); <START> this.urlIndexInterface = new UrlIndexHttp(this.userLog, geoserverUrl); <END> }</code><technical_language>perhap this.urlIndexerReader = new HttpIndexReader clearer</technical_language>

Target:
public GoGoDuck(String geoserverUrl, String profile, String subset, String outputFile, Integer limit) { this(profile, subset, outputFile, limit); this.indexReader = new HttpIndexReader(this.userLog, geoserverUrl); }
Source:
<code>public UserCredentials getCredentials(PrivilegeLevel level) { if (level == PrivilegeLevel.ADMIN) { <START> UserCredentials credentials = super.getCredentials(PrivilegeLevel.USER); <END> return new UserCredentials(getAdminUserName(), credentials.getPassword()); } return super.getCredentials(level); }</code><technical_language>This means if admin password is in credentials.properties, ignore it. to: try { return super.getCredentials(level); } catch (AssertionFailedError e) { if (level == PrivilegeLevel.ADMIN) { UserCredentials credentials = super.getCredentials(PrivilegeLevel.USER); return new UserCredentials("admin@mylyn.eclipse.org", credentials.getPassword()); } throw e; }</technical_language>

Target:
public UserCredentials getCredentials(PrivilegeLevel level) { try { return super.getCredentials(level); } catch (AssertionFailedError e) { if (level == PrivilegeLevel.ADMIN) { UserCredentials credentials = super.getCredentials(PrivilegeLevel.USER); return new UserCredentials("admin@mylyn.eclipse.org", credentials.getPassword()); } throw e; } }
Source:
<code>public Factory updateFactory(Factory update, Set<FactoryImage> images) throws ConflictException, NotFoundException, ServerException { requireNonNull(update); final AuthorImpl creator = factoryDao.getById(update.getId()).getCreator(); FactoryImpl updateImpl = new FactoryImpl(update, images); <START> if (isNullOrEmpty(updateImpl.getName())) { <END> updateImpl.setName(NameGenerator.generate("f", 9)); } return factoryDao.update(FactoryImpl.builder() .from(updateImpl) .setCreator(new AuthorImpl(creator.getUserId(), creator.getCreated())) .build()); }</code><technical_language>generate new name update it. set name is null empty in update</technical_language>

Target:
public Factory updateFactory(Factory update, Set<FactoryImage> images) throws ConflictException, NotFoundException, ServerException { requireNonNull(update); final AuthorImpl creator = factoryDao.getById(update.getId()).getCreator(); return factoryDao.update(FactoryImpl.builder() .from(new FactoryImpl(update, images)) .setCreator(new AuthorImpl(creator.getUserId(), creator.getCreated())) .build()); }
Source:
<code>public Attribute(long id, String backgroundColour, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, int textSize) { <START> setId(id); <END> setBackgroundColour(backgroundColour); setHorizontalAlignment(horizontalAlignment); setVerticalAlignment(verticalAlignment); setTextSize(textSize); }</code><technical_language>remove private setters? necessary private setters, reduce size of class</technical_language>

Target:
public Attribute(long id, String backgroundColour, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, int textSize) { this.id = id; this.backgroundColour = backgroundColour; this.horizontalAlignment = horizontalAlignment; this.verticalAlignment = verticalAlignment; this.textSize = textSize; }
Source:
<code>public void reverse() { <START> Element current = head; <END> Element next; Element previous = null; while (Objects.nonNull(current)) { next = current.next; current.next = previous; previous = current; current = next; } head = previous; }</code><technical_language>Element<T></technical_language>

Target:
public void reverse() { Element<T> current = head; Element<T> next; Element<T> previous = null; while (Objects.nonNull(current)) { next = current.next; current.next = previous; previous = current; current = next; } head = previous; }
Source:
<code>public void visitNode(Tree tree) { Context ctx = new Context(); boolean issue = false; if (tree.is(Kind.FOR_STATEMENT)) { issue = checkFor((ForStatementTree) tree, ctx); } else if (tree.is(Kind.WHILE_STATEMENT)) { issue = checkWhile((WhileStatementTree) tree, ctx); } else { issue = checkForEach((ForEachStatement) tree); } if (issue) { StatementTree statement = getStatement(tree); <START> reportIssue(statement, "Use \"Arrays.copyOf\", \"Arrays.asList\", \"Collections.add\" or \"System.arraycopy\" instead."); <END> } }</code><technical_language>I method do "Collections.add", java.util.Collections#addAll</technical_language>

Target:
public void visitNode(Tree tree) { boolean issue; if (tree.is(Kind.FOR_STATEMENT)) { issue = checkFor((ForStatementTree) tree); } else if (tree.is(Kind.WHILE_STATEMENT)) { issue = checkWhile((WhileStatementTree) tree); } else { issue = checkForEach((ForEachStatement) tree); } if (issue) { StatementTree statement = getStatement(tree); reportIssue(statement, "Use \"Arrays.copyOf\", \"Arrays.asList\", \"Collections.addAll\" or \"System.arraycopy\" instead."); } }
Source:
<code>public void testIt() throws Exception { ZkHostDomainPartition hdpc = ZkHostDomainPartition.create(getZk(), getRoot(), 1234, 7); assertEquals(1234, hdpc.getPartNum()); assertNull("current version should be unset", hdpc.getCurrentDomainGroupVersion()); assertEquals(Integer.valueOf(7), hdpc.getUpdatingToDomainGroupVersion()); hdpc.setCurrentDomainGroupVersion(7); assertEquals(Integer.valueOf(7), hdpc.getCurrentDomainGroupVersion()); hdpc.setUpdatingToDomainGroupVersion(8); assertEquals(Integer.valueOf(8), hdpc.getUpdatingToDomainGroupVersion()); hdpc.setUpdatingToDomainGroupVersion(null); assertNull(hdpc.getUpdatingToDomainGroupVersion()); List<String> currentCountKeys = new ArrayList<String>(); hdpc.setCount("TotalHits", 45); currentCountKeys.add("TotalHits"); assertEquals(new Long(45), hdpc.getCount("TotalHits")); hdpc.setCount("RandomCount", 1); currentCountKeys.add("RandomCount"); <START> assertTrue(hdpc.getCountKeys().containsAll(currentCountKeys) && hdpc.getCountKeys().size() == currentCountKeys.size()); <END> hdpc.removeCount("RandomCount"); currentCountKeys.remove("RandomCount"); assertTrue(hdpc.getCountKeys().containsAll(currentCountKeys) && hdpc.getCountKeys().size() == currentCountKeys.size()); assertNotNull(hdpc.getCount("TotalHits")); assertNull(hdpc.getCount("RandomCount")); assertNull(hdpc.getCount("NewCount")); }</code><technical_language>do more test in assert. push size equality part assertEquals next line</technical_language>

Target:
public void testIt() throws Exception { ZkHostDomainPartition hdpc = ZkHostDomainPartition.create(getZk(), getRoot(), 1234, 7); assertEquals(1234, hdpc.getPartNum()); assertNull("current version should be unset", hdpc.getCurrentDomainGroupVersion()); assertEquals(Integer.valueOf(7), hdpc.getUpdatingToDomainGroupVersion()); hdpc.setCurrentDomainGroupVersion(7); assertEquals(Integer.valueOf(7), hdpc.getCurrentDomainGroupVersion()); hdpc.setUpdatingToDomainGroupVersion(8); assertEquals(Integer.valueOf(8), hdpc.getUpdatingToDomainGroupVersion()); hdpc.setUpdatingToDomainGroupVersion(null); assertNull(hdpc.getUpdatingToDomainGroupVersion()); Set<String> currentCountKeys = new HashSet<String>(); hdpc.setCount("TotalHits", 45); currentCountKeys.add("TotalHits"); assertEquals(new Long(45), hdpc.getCount("TotalHits")); hdpc.setCount("TotalHits", 50); assertEquals(new Long(50), hdpc.getCount("TotalHits")); hdpc.setCount("RandomCount", 1); currentCountKeys.add("RandomCount"); assertTrue(hdpc.getCountKeys().equals(currentCountKeys)); hdpc.removeCount("RandomCount"); currentCountKeys.remove("RandomCount"); assertTrue(hdpc.getCountKeys().containsAll(currentCountKeys) && hdpc.getCountKeys().size() == currentCountKeys.size()); assertNull(hdpc.getCount("RandomCount")); assertNull(hdpc.getCount("NewCount")); }
Source:
<code>public void run() { File folder = new File(System.getProperty("user.dir") + "/traces"); folder.mkdir(); <START> File f = new File(folder.getAbsolutePath() + "/" + new Date().toString() + ".trace"); <END> File sf = new File(folder.getAbsolutePath() + "/" + new Date().toString() + ".sym"); try (FileOutputStream fos = new FileOutputStream(f); FileOutputStream sfos = new FileOutputStream(sf); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(sfos))) { while (true) { ByteBuffer b = ActorExecutionTrace.fullBuffers.take(); fos.getChannel().write(b); b.rewind(); if (front != null) { synchronized (symbolsToWrite) { front.sendSymbols(ActorExecutionTrace.symbolsToWrite); } front.sendTracingData(b); } synchronized (symbolsToWrite) { for (SSymbol s : symbolsToWrite) { bw.write(s.getSymbolId() + ":" + s.getString()); bw.newLine(); } ActorExecutionTrace.symbolsToWrite.clear(); } b.clear(); ActorExecutionTrace.emptyBuffers.add(b); } } catch (FileNotFoundException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } }</code><technical_language>good if trace file names configured a option ./som launcher, possibly passed in some -Dsom.trace$$ java property. trace file a deterministic name handled easier scripts, important for experiments</technical_language>

Target:
public void run() { File f = new File(VmSettings.TRACE_FILE + ".trace"); File sf = new File(VmSettings.TRACE_FILE + ".sym"); f.getParentFile().mkdirs(); try (FileOutputStream fos = new FileOutputStream(f); FileOutputStream sfos = new FileOutputStream(sf); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(sfos))) { while (true) { ByteBuffer b = ActorExecutionTrace.fullBuffers.take(); fos.getChannel().write(b); b.rewind(); if (front != null) { synchronized (symbolsToWrite) { front.sendSymbols(ActorExecutionTrace.symbolsToWrite); } front.sendTracingData(b); } synchronized (symbolsToWrite) { for (SSymbol s : symbolsToWrite) { bw.write(s.getSymbolId() + ":" + s.getString()); bw.newLine(); } ActorExecutionTrace.symbolsToWrite.clear(); } b.clear(); ActorExecutionTrace.emptyBuffers.add(b); } } catch (FileNotFoundException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } }
Source:
<code>public Attribute getAttributeValue(PerunSessionImpl sess, Facility facility, AttributeDefinition attributeDefinition) throws InternalErrorException { Attribute attribute = new Attribute(attributeDefinition); Attribute gidNamespaceAttribute = getUnixGIDNamespaceAttribute(sess, facility); if(gidNamespaceAttribute.getValue() == null) return attribute; Attribute namespaceGIDRangesAttribute = getNamespaceGIDRangesAttribute(sess, (String) gidNamespaceAttribute.getValue()); <START> Utils.copyAttributeToVirtualAttributeWithValue(namespaceGIDRangesAttribute, attribute); <END> return attribute; }</code><technical_language>I change this return Utils.copyAttributeToVirtual......</technical_language>

Target:
public Attribute getAttributeValue(PerunSessionImpl sess, Facility facility, AttributeDefinition attributeDefinition) throws InternalErrorException { Attribute attribute = new Attribute(attributeDefinition); Attribute gidNamespaceAttribute = getUnixGIDNamespaceAttribute(sess, facility); if(gidNamespaceAttribute.getValue() == null) return attribute; Attribute namespaceGIDRangesAttribute = getNamespaceGIDRangesAttribute(sess, (String) gidNamespaceAttribute.getValue()); return Utils.copyAttributeToVirtualAttributeWithValue(namespaceGIDRangesAttribute, attribute); }
Source:
<code>public InstitutesStatsMetadata() { <START> statsSince = Instant.parse("2011-10-01T00:00:00.00Z"); <END> }</code><technical_language>@xpdavid forget change this merging</technical_language>

Target:
public InstitutesStatsMetadata() { statsSince = Instant.parse("2010-01-01T00:00:00.000Z"); }
Source:
<code>public MockBarChartDataModel(MockBarChartView view) { super(view.getChartWidget().getData()); <START> this.view = view; <END> dataSeries = new BarDataset(); setDefaultStylingProperties(); addDataSeriesToChart(); }</code><technical_language>about: if of DataModel types a specific view type, add additional generic parameter MockChartDataModel for view type in addition dataset. This allow move view field superclass</technical_language>

Target:
public MockBarChartDataModel(MockBarChartView view) { super(view); dataSeries = new BarDataset(); setDefaultStylingProperties(); addDataSeriesToChart(); }
Source:
<code>private static void onUpgrade(final int oldVersionCode, final int newVersionCode) { if (oldVersionCode < 1050004) { if(MediaPlayer.isPrestoLibraryInstalled(context) && Build.VERSION.SDK_INT >= 16) { UserPreferences.enableSonic(); } } if (oldVersionCode < 1070196) { int oldValueInDays = UserPreferences.getEpisodeCleanupValue(); if (oldValueInDays > 0) { UserPreferences.setEpisodeCleanupValue(oldValueInDays * 24); } } if (oldVersionCode < 1070197) { <START> if (prefs.getBoolean(UserPreferences.PREF_MOBILE_UPDATE_OLD, false)) { <END> prefs.edit().putString(UserPreferences.PREF_MOBILE_UPDATE, "everything").apply(); } } }</code><technical_language>read boolean a string (I assume this return "true" "false"), migrate if new pref key</technical_language>

Target:
private static void onUpgrade(final int oldVersionCode, final int newVersionCode) { if (oldVersionCode < 1050004) { if(MediaPlayer.isPrestoLibraryInstalled(context) && Build.VERSION.SDK_INT >= 16) { UserPreferences.enableSonic(); } } if (oldVersionCode < 1070196) { int oldValueInDays = UserPreferences.getEpisodeCleanupValue(); if (oldValueInDays > 0) { UserPreferences.setEpisodeCleanupValue(oldValueInDays * 24); } } if (oldVersionCode < 1070197) { if (prefs.getBoolean("prefMobileUpdate", false)) { prefs.edit().putString(UserPreferences.PREF_MOBILE_UPDATE, "everything").apply(); } } }
Source:
<code>public void dataCenterDoesntExist() throws Exception { <START> doReturn(null).when(validator).getDataCenter(); END> assertEquals(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST).getMessage(), validator.dataCenterExists().getMessage()); }</code><technical_language>Please replace doReturn() when() entire file, i.e. when(validator.getDataCenter()).thenReturn(null);</technical_language>

Target:
public void dataCenterDoesntExist() throws Exception { doReturn(null).when(validator).getDataCenter(); assertEquals(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST), validator.dataCenterExists()); }
Source:
<code><START> private NodeAvailabilityStatus getStatusByRunningOperationsOnEachHost() { <END> int numberOfUnreachableNodes = 0; for (InetSocketAddress host : clientPool.currentPools.keySet()) { try { clientPool.runOnHost(host, CassandraVerifier.healthCheck); if (!partitionerIsValid(host)) { return NodeAvailabilityStatus.TERMINAL; } } catch (Exception e) { numberOfUnreachableNodes++; } } return getClusterAvailabilityStatus(numberOfUnreachableNodes); }</code><technical_language>nit: please move this method doesConfigReplicationFactorMatchWithCluster, match order in called</technical_language>

Target:
private NodeAvailabilityStatus getStatusByRunningOperationsOnEachHost() { int countUnreachableNodes = 0; for (InetSocketAddress host : clientPool.currentPools.keySet()) { try { clientPool.runOnHost(host, CassandraVerifier.healthCheck); if (!partitionerIsValid(host)) { return NodeAvailabilityStatus.TERMINAL; } } catch (Exception e) { countUnreachableNodes++; } } return getClusterAvailabilityStatus(countUnreachableNodes); }
Source:
<code>public void setCollectionNameExpression(Expression collectionNameExpression) { <START> this.collectionNameExpression = collectionNameExpression; <END> }</code><technical_language>Assert.notNull()</technical_language>

Target:
public void setCollectionNameExpression(Expression collectionNameExpression) { Assert.notNull(collectionNameExpression, "collectionNameExpression must not be null."); this.collectionNameExpression = collectionNameExpression; }
Source:
<code>public static void main(String[] args) throws IOException { ClassLoader loader = Nd4jEx16_Serialization.class.getClassLoader(); INDArray arrWrite = Nd4j.linspace(1,25,25).reshape(5,5); String pathname = "tmp.bin"; DataOutputStream sWrite = new DataOutputStream(new FileOutputStream(new File(pathname ))); Nd4j.write(arrWrite, sWrite); DataInputStream sRead = new DataInputStream(new FileInputStream(new File(pathname ))); INDArray arrRead = Nd4j.read(sRead); System.out.println("Read from binary format:" ); <START> System.out.println(arrRead ); <END> File file = new File( Objects.requireNonNull(loader.getResource("twentyfive.npy")).getFile()); INDArray x = Nd4j.createFromNpyFile(file); System.out.println(); System.out.println("Read from Numpy .npyformat:" ); System.out.println(x); file = new File(pathname); Nd4j.saveBinary(arrWrite, file); arrRead = Nd4j.readBinary(file ); System.out.println(); System.out.println("Read from Numpy .npyformat:" ); System.out.println(arrRead); file = new File( Objects.requireNonNull(loader.getResource("twentyfive.csv")).getFile()); String Filename = file.getAbsolutePath(); arrRead = Nd4j.readNumpy(Filename, ","); System.out.println(); System.out.println("Read from csv format:" ); System.out.println(arrRead); }</code><technical_language>practice streams (input output) is try-with-resources close</technical_language>

Target:
public static void main(String[] args) throws Exception { ClassLoader loader = Nd4jEx16_Serialization.class.getClassLoader(); INDArray arrWrite = Nd4j.linspace(1,25,25).reshape(5,5); String pathname = "tmp.bin"; try(DataOutputStream sWrite = new DataOutputStream(new FileOutputStream(new File(pathname )))){ Nd4j.write(arrWrite, sWrite); } INDArray arrRead; try(DataInputStream sRead = new DataInputStream(new FileInputStream(new File(pathname )))){ arrRead = Nd4j.read(sRead); } System.out.println("Read from binary stream:" ); System.out.println(arrRead ); File file = new File("nd4j.npy" ); Nd4j.writeAsNumpy(arrRead, file ); arrRead = Nd4j.createFromNpyFile(file); System.out.println(); System.out.println("Read from Numpy .npy format:" ); System.out.println(arrRead); file = new File( Objects.requireNonNull(loader.getResource("numpyz.npz")).getFile()); Map<String, INDArray> arrayMap = Nd4j.createFromNpzFile(file); System.out.println(); System.out.println("Read from Numpy .npz format:" ); System.out.println(arrayMap.get("arr_0")); System.out.println(arrayMap.get("arr_1")); file = new File(pathname); Nd4j.saveBinary(arrWrite, file); arrRead = Nd4j.readBinary(file ); System.out.println(); System.out.println("Read from binary format:" ); System.out.println(arrRead); file = new File( Objects.requireNonNull(loader.getResource("twentyfive.csv")).getFile()); String Filename = file.getAbsolutePath(); arrRead = Nd4j.readNumpy(Filename, ","); System.out.println(); System.out.println("Read from csv format:" ); System.out.println(arrRead); }
Source:
<code><START> public synchronized Map<String, Pattern> regexpPropertiesMap() { <END> if (regexpProps == null) { regexpProps = new HashMap<>(props.size()); for (Map.Entry<Object, Object> val : props.entrySet()) { try { Pattern p = Pattern.compile((String) val.getValue()); regexpProps.put((String) val.getKey(), p); } catch (PatternSyntaxException e) { ActiveMQServerLogger.LOGGER.warn("Ignoring invalid regexp: " + val.getValue()); } } } return regexpProps; }</code><technical_language>a [Suppliers::memoize](<LINK_0> allow a thread-safe lazy initialization method synchronized need get regexpProps. is is needed</technical_language>

Target:
public synchronized Map<String, Pattern> regexpPropertiesMap() { if (regexpProps == null) { regexpProps = new HashMap<>(props.size()); for (Map.Entry<Object, Object> val : props.entrySet()) { String str = (String) val.getValue(); if (looksLikeRegexp(str)) { try { Pattern p = Pattern.compile(str.substring(1, str.length() - 1)); regexpProps.put((String) val.getKey(), p); } catch (PatternSyntaxException e) { ActiveMQServerLogger.LOGGER.warn("Ignoring invalid regexp: " + str); } } } } return regexpProps; }
Source:
<code>public FormValidation doCheckUrl(@QueryParameter("url") String resourceRootUrlString) { <START> Jenkins.get().checkPermission(Jenkins.CONFIGURE); <END> return checkUrl(resourceRootUrlString, true); }</code><technical_language>Revert, this admin thing</technical_language>

Target:
public FormValidation doCheckUrl(@QueryParameter("url") String resourceRootUrlString) { Jenkins.get().checkPermission(Jenkins.ADMINISTER); return checkUrl(resourceRootUrlString, true); }
Source:
<code>public void testDrivingSimpleTopology() { final int partition = 10; driver = new TopologyTestDriver(createSimpleTopology(partition), props); final TestInputTopic<String, String> inputTopic = driver.createInputTopic(INPUT_TOPIC_1, STRING_SERIALIZER, STRING_SERIALIZER, Instant.ofEpochMilli(0L), Duration.ZERO); final TestOutputTopic<String, String> outputTopic1 = driver.createOutputTopic(OUTPUT_TOPIC_1, Serdes.String().deserializer(), Serdes.String().deserializer()); final TestOutputTopic<String, String> outputTopic2 = driver.createOutputTopic(OUTPUT_TOPIC_1, Serdes.String().deserializer(), Serdes.String().deserializer()); inputTopic.pipeInput("key1", "value1"); assertNextOutputRecord(outputTopic1.readRecord(), "key1", "value1"); assertTrue(outputTopic1.isEmpty()); inputTopic.pipeInput("key2", "value2"); assertNextOutputRecord(outputTopic1.readRecord(), "key2", "value2"); <START> assertTrue(outputTopic1.isEmpty()); <END> inputTopic.pipeInput("key3", "value3"); inputTopic.pipeInput("key4", "value4"); inputTopic.pipeInput("key5", "value5"); assertNextOutputRecord(outputTopic1.readRecord(), "key3", "value3"); assertNextOutputRecord(outputTopic1.readRecord(), "key4", "value4"); assertNextOutputRecord(outputTopic1.readRecord(), "key5", "value5"); assertTrue(outputTopic1.isEmpty()); }</code><technical_language>eliminate partition check in assertNextOutputRecord method</technical_language>

Target:
public void testDrivingSimpleTopology() { final int partition = 10; driver = new TopologyTestDriver(createSimpleTopology(partition), props); final TestInputTopic<String, String> inputTopic = driver.createInputTopic(INPUT_TOPIC_1, STRING_SERIALIZER, STRING_SERIALIZER, Instant.ofEpochMilli(0L), Duration.ZERO); final TestOutputTopic<String, String> outputTopic1 = driver.createOutputTopic(OUTPUT_TOPIC_1, Serdes.String().deserializer(), Serdes.String().deserializer()); inputTopic.pipeInput("key1", "value1"); assertNextOutputRecord(outputTopic1.readRecord(), "key1", "value1"); assertTrue(outputTopic1.isEmpty()); inputTopic.pipeInput("key2", "value2"); assertNextOutputRecord(outputTopic1.readRecord(), "key2", "value2"); assertTrue(outputTopic1.isEmpty()); inputTopic.pipeInput("key3", "value3"); inputTopic.pipeInput("key4", "value4"); inputTopic.pipeInput("key5", "value5"); assertNextOutputRecord(outputTopic1.readRecord(), "key3", "value3"); assertNextOutputRecord(outputTopic1.readRecord(), "key4", "value4"); assertNextOutputRecord(outputTopic1.readRecord(), "key5", "value5"); assertTrue(outputTopic1.isEmpty()); }