auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testClippingOfRecordWithSoftClipBasesAtTheEnd() { final SAMFileHeader header = new SAMFileHeader(); header.addSequence(new SAMSequenceRecord("1", 1000)); final SAMRecord record = new SAMRecord(header); record.setReadPairedFlag(true); record.setCigar(new Cigar(Arrays.asList(new CigarElement(5, CigarOperator.M), new CigarElement(5, CigarOperator.S)))); record.setReferenceIndex(0); record.setAlignmentStart(1); record.setMateAlignmentStart(5); record.setMateReferenceIndex(0); record.setReadBases("AAAAAAAAAA".getBytes()); final int numToClip = SAMUtils.getNumOverlappingBasesToClip(record); Assert.assertEquals(numToClip, 1); SAMUtils.clipOverlappingBases(record, numToClip, false); final Cigar cigar = record.getCigar(); Assert.assertEquals(cigar.numCigarElements(), 2); Assert.assertEquals(cigar.getCigarElement(0).getLength(), 4); Assert.assertEquals(cigar.getCigarElement(0).getOperator(), CigarOperator.M); Assert.assertEquals(cigar.getCigarElement(1).getLength(), 6); Assert.assertEquals(cigar.getCigarElement(1).getOperator(), CigarOperator.S); }

Target:
public void testClippingOfRecordWithSoftClipBasesAtTheEnd() { final SAMFileHeader header = new SAMFileHeader(); header.addSequence(new SAMSequenceRecord("1", 1000)); final SAMRecord record = new SAMRecord(header); record.setReadPairedFlag(true); record.setCigar(TextCigarCodec.decode("5M5S")); record.setReferenceIndex(0); record.setAlignmentStart(1); record.setMateAlignmentStart(5); record.setMateReferenceIndex(0); record.setReadBases("AAAAAAAAAA".getBytes()); final int numToClip = SAMUtils.getNumOverlappingAlignedBasesToClip(record); Assert.assertEquals(numToClip, 1); SAMUtils.clipOverlappingAlignedBases(record, numToClip, false); Assert.assertTrue(record.getCigar().equals(TextCigarCodec.decode("4M6S"))); }
Source:
private List<String> tryMergeDictionary() { final Set<String> mergedDictionary = new HashSet<>(); long totalDictionarySize = 0L; for (SpillingGrouper<KeyType> grouper : groupers) { final List<String> dictionary = grouper.getDictionary(); for (String key : dictionary) { if (!mergedDictionary.contains(key)) { totalDictionarySize += RowBasedGrouperHelper.estimateStringKeySize(key); if (totalDictionarySize > maxDictionarySizeForCombiner) { return null; } mergedDictionary.add(key); } } } return ImmutableList.copyOf(mergedDictionary); }

Target:
private List<String> tryMergeDictionary() { final Set<String> mergedDictionary = new HashSet<>(); long totalDictionarySize = 0L; for (SpillingGrouper<KeyType> grouper : groupers) { final List<String> dictionary = grouper.mergeAndGetDictionary(); for (String key : dictionary) { if (mergedDictionary.add(key)) { totalDictionarySize += RowBasedGrouperHelper.estimateStringKeySize(key); if (totalDictionarySize > maxDictionarySizeForCombiner) { return null; } } } } return ImmutableList.copyOf(mergedDictionary); }
Source:
private void enableLoadBalancer() { if (Config.<Boolean>getValue(ConfigValues.EnableVdsLoadBalancing)) { log.info("Start scheduling to enable vds load balancer"); executor.scheduleWithFixedDelay(() -> performLoadBalancing(), Config.<Integer>getValue(ConfigValues.VdsLoadBalancingIntervalInMinutes), Config.<Integer>getValue(ConfigValues.VdsLoadBalancingIntervalInMinutes), TimeUnit.MINUTES); log.info("Finished scheduling to enable vds load balancer"); } }

Target:
private void enableLoadBalancer() { if (Config.<Boolean>getValue(ConfigValues.EnableVdsLoadBalancing)) { log.info("Start scheduling to enable vds load balancer"); executor.scheduleWithFixedDelay(this::performLoadBalancing, Config.<Integer>getValue(ConfigValues.VdsLoadBalancingIntervalInMinutes), Config.<Integer>getValue(ConfigValues.VdsLoadBalancingIntervalInMinutes), TimeUnit.MINUTES); log.info("Finished scheduling to enable vds load balancer"); } }
Source:
void relink(Link link) { if (this.link != link) { reclaimSpace(LINK_CAPACITY); } this.link = link; }

Target:
void relink(Link link) { reclaimSpace(LINK_CAPACITY); this.link = link; }
Source:
public Map<Integer, String> getCrossExpansions(final Set<Integer> gids, final Integer level, final CrossExpansionProperties crossExpansionProperties) { if (gids.size() > 5000) { throw new IllegalArgumentException( "Max set size has to be less than 5000." + " Any thing about this might casue caching and performace issues."); } final Monitor monitor = MonitorFactory.start( "org.generationcp.middleware.service.pedigree.PedigreeServiceImpl.getCrossExpansion(List<Integer>, Integer, CrossExpansionProperties)"); final Map<Integer, String> pedigreeStrings = new HashMap<>(); try { final int numberOfLevelsToTraverse = level == null ? crossExpansionProperties.getCropGenerationLevel(this.getCropName()) : level; final GermplasmCache germplasmAncestryCache = new GermplasmCache(germplasmDataManager, getNumberOfLevelsToTraverseInDb(numberOfLevelsToTraverse)); germplasmAncestryCache.initialisesCache(this.getCropName(), gids, getNumberOfLevelsToTraverseInDb(numberOfLevelsToTraverse)); for (Integer gid : gids) { pedigreeStrings.put(gid, buildPeidgreeString(gid, level, crossExpansionProperties, germplasmAncestryCache, numberOfLevelsToTraverse)); } return pedigreeStrings; } finally { monitor.stop(); } }

Target:
public Map<Integer, String> getCrossExpansions(final Set<Integer> gids, final Integer level, final CrossExpansionProperties crossExpansionProperties) { if (gids.size() > 5000) { throw new IllegalArgumentException( "Max set size has to be less than 5000." + " Any thing about this might casue caching and performace issues."); } final Monitor monitor = MonitorFactory.start( "org.generationcp.middleware.service.pedigree.PedigreeServiceImpl.getCrossExpansion(List<Integer>, Integer, CrossExpansionProperties)"); final Map<Integer, String> pedigreeStrings = new HashMap<>(); try { final int numberOfLevelsToTraverse = level == null ? crossExpansionProperties.getCropGenerationLevel(this.getCropName()) : level; final GermplasmCache germplasmAncestryCache = new GermplasmCache(germplasmDataManager, getNumberOfLevelsToTraverseInDb(numberOfLevelsToTraverse)); germplasmAncestryCache.initialiseCache(this.getCropName(), gids, getNumberOfLevelsToTraverseInDb(numberOfLevelsToTraverse)); for (final Integer gid : gids) { pedigreeStrings.put(gid, buildPedigreeString(gid, level, crossExpansionProperties, germplasmAncestryCache, numberOfLevelsToTraverse)); } return pedigreeStrings; } finally { monitor.stop(); } }
Source:
public void testRefundWithSplit() throws Throwable { transaction = transactionFactory.createCreditCardTransactionWithoutPinMode(); transaction.setCapture(true); transaction.setAmount(10000); Collection<SplitRule> splitRules = new ArrayList<SplitRule>(); Recipient recipient1 = recipientFactory.create(); recipient1.save(); SplitRule splitRule = new SplitRule(); splitRule.setRecipientId(recipient1.getId()); splitRule.setPercentage(50); splitRule.setLiable(true); splitRule.setChargeProcessingFee(true); splitRules.add(splitRule); Recipient recipient2 = recipientFactory.create(); SplitRule splitRule2 = new SplitRule(); recipient2.save(); splitRule2.setRecipientId(recipient2.getId()); splitRule2.setPercentage(50); splitRule2.setLiable(true); splitRule2.setChargeProcessingFee(true); splitRules.add(splitRule2); transaction.setSplitRules(splitRules); transaction.save(); Transaction foundTransaction = new Transaction().find(transaction.getId()); List<SplitRule> foundSplitRules = (List<SplitRule>) foundTransaction.getSplitRules(); foundSplitRules.get(0).setAmount(2000); foundSplitRules.get(1).setAmount(2000); Integer refundedAmount = 4000; foundTransaction.refundWithSplit(refundedAmount, foundSplitRules); assertEquals(refundedAmount, foundTransaction.getRefundedAmount()); List<Payable> payables = (List<Payable>) foundTransaction.payables(); Integer payableExcpetedAmount = -2000; assertEquals(payables.get(0).getAmount(), payableExcpetedAmount); assertEquals(payables.get(1).getAmount(), payableExcpetedAmount); }

Target:
public void testRefundWithSplit() throws Throwable { transaction = transactionFactory.createCreditCardTransactionWithoutPinMode(); transaction.setCapture(true); transaction.setAmount(10000); Collection<SplitRule> splitRules = new ArrayList<SplitRule>(); Recipient recipient1 = recipientFactory.create(); recipient1.save(); SplitRule splitRule = new SplitRule(); splitRule.setRecipientId(recipient1.getId()); splitRule.setPercentage(50); splitRule.setLiable(true); splitRule.setChargeProcessingFee(true); splitRules.add(splitRule); Recipient recipient2 = recipientFactory.create(); SplitRule splitRule2 = new SplitRule(); recipient2.save(); splitRule2.setRecipientId(recipient2.getId()); splitRule2.setPercentage(50); splitRule2.setLiable(true); splitRule2.setChargeProcessingFee(true); splitRules.add(splitRule2); transaction.setSplitRules(splitRules); transaction.save(); Transaction foundTransaction = new Transaction().find(transaction.getId()); List<SplitRule> foundSplitRules = (List<SplitRule>) foundTransaction.getSplitRules(); foundSplitRules.get(0).setAmount(2000); foundSplitRules.get(1).setAmount(2000); Integer refundedAmount = 4000; foundTransaction.refundWithSplit(refundedAmount, foundSplitRules); assertEquals(refundedAmount, foundTransaction.getRefundedAmount()); List<Payable> payables = (List<Payable>) foundTransaction.payables(); Integer payableExpectedAmount = -2000; assertEquals(payables.get(0).getAmount(), payableExpectedAmount); assertEquals(payables.get(1).getAmount(), payableExpectedAmount); }
Source:
public AccessResultCode writeUpdatedAlarmNotifications(final DlmsConnectionHolder conn, final long alarmFilterLongValue) throws IOException, TimeoutException { final AttributeAddress alarmFilterValue = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final DataObject value = DataObject.newUInteger32Data(alarmFilterLongValue); final SetParameter setParameter = new SetParameter(alarmFilterValue, value); if (conn.hasDlmsMessageListener()) { conn.getDlmsMessageListener().setDescription("SetAlarmNotifications write updated value " + alarmFilterLongValue + ", set attribute: " + this.describeAttributes(alarmFilterValue)); } return conn.getConnection().set(setParameter); }

Target:
public AccessResultCode writeUpdatedAlarmNotifications(final DlmsConnectionHolder conn, final long alarmFilterLongValue) throws IOException, TimeoutException { final AttributeAddress alarmFilterValue = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final DataObject value = DataObject.newUInteger32Data(alarmFilterLongValue); final SetParameter setParameter = new SetParameter(alarmFilterValue, value); conn.getDlmsMessageListener().setDescription("SetAlarmNotifications write updated value " + alarmFilterLongValue + ", set attribute: " + JdlmsObjectToStringUtil.describeAttributes(alarmFilterValue)); return conn.getConnection().set(setParameter); }
Source:
public void testExceededContentLengthLimit() throws Exception { String container = "test-container"; String blobName = "test-blob"; AzureBlobClient client = createMock(AzureBlobClient.class); PayloadSlicer slicer = createMock(PayloadSlicer.class); MutableBlobMetadata metadata = new MutableBlobMetadataImpl(); MutableContentMetadata contentMetadata = new BaseMutableContentMetadata(); contentMetadata.setContentLength(MultipartUploadStrategy.MAX_BLOCK_SIZE * MultipartUploadStrategy.MAX_NUMBER_OF_BLOCKS + 1); metadata.setName(blobName); metadata.setContentMetadata(contentMetadata); Blob blob = new BlobImpl(metadata); Payload payload = new StringPayload("ABCD"); payload.setContentMetadata(contentMetadata); blob.setPayload(payload); AzureBlobBlockUploadStrategy strat = new AzureBlobBlockUploadStrategy(client, slicer); strat.execute(container, blob); }

Target:
public void testExceededContentLengthLimit() throws Exception { String container = "test-container"; String blobName = "test-blob"; AzureBlobClient client = createNiceMock(AzureBlobClient.class); PayloadSlicer slicer = createNiceMock(PayloadSlicer.class); MutableBlobMetadata metadata = new MutableBlobMetadataImpl(); MutableContentMetadata contentMetadata = new BaseMutableContentMetadata(); contentMetadata.setContentLength(MultipartUploadStrategy.MAX_BLOCK_SIZE * MultipartUploadStrategy.MAX_NUMBER_OF_BLOCKS + 1); metadata.setName(blobName); metadata.setContentMetadata(contentMetadata); Blob blob = new BlobImpl(metadata); ByteSource bytes = ByteSource.wrap("ABCD".getBytes(Charsets.UTF_8)); Payload payload = Payloads.newByteSourcePayload(bytes); payload.setContentMetadata(contentMetadata); blob.setPayload(payload); AzureBlobBlockUploadStrategy strat = new AzureBlobBlockUploadStrategy(client, slicer); strat.execute(container, blob); }
Source:
public void listRevisionsWithPaginationAndRepeatStream() { final int numberExpected = 50; List<ConfigurationSetting> settings = new ArrayList<>(numberExpected); for (int value = 0; value < numberExpected; value++) { settings.add(new ConfigurationSetting().key(keyPrefix).value("myValue" + value).label(labelPrefix)); } List<Mono<Response<ConfigurationSetting>>> results = new ArrayList<>(); for (ConfigurationSetting setting : settings) { results.add(client.setSettingWithResponse(setting)); } SettingSelector filter = new SettingSelector().keys(keyPrefix).labels(labelPrefix); Flux.merge(results).blockLast(); List<ConfigurationSetting> configurationSettingList1 = new ArrayList<>(); List<ConfigurationSetting> configurationSettingList2 = new ArrayList<>(); PagedFlux<ConfigurationSetting> configurationSettingPagedFlux = client.listSettingRevisions(filter); configurationSettingPagedFlux.toStream().forEach(configurationSetting -> configurationSettingList1.add(configurationSetting)); assertEquals(numberExpected, configurationSettingList1.size()); configurationSettingPagedFlux.toStream().forEach(configurationSetting -> configurationSettingList2.add(configurationSetting)); assertEquals(numberExpected, configurationSettingList2.size()); }

Target:
public void listRevisionsWithPaginationAndRepeatStream() { final int numberExpected = 50; List<ConfigurationSetting> settings = new ArrayList<>(numberExpected); List<Mono<Response<ConfigurationSetting>>> results = new ArrayList<>(); for (int value = 0; value < numberExpected; value++) { ConfigurationSetting setting = new ConfigurationSetting().key(keyPrefix).value("myValue" + value).label(labelPrefix); settings.add(setting); results.add(client.setSettingWithResponse(setting)); } SettingSelector filter = new SettingSelector().keys(keyPrefix).labels(labelPrefix); Flux.merge(results).blockLast(); List<ConfigurationSetting> configurationSettingList1 = new ArrayList<>(); List<ConfigurationSetting> configurationSettingList2 = new ArrayList<>(); PagedFlux<ConfigurationSetting> configurationSettingPagedFlux = client.listSettingRevisions(filter); configurationSettingPagedFlux.toStream().forEach(configurationSetting -> configurationSettingList1.add(configurationSetting)); assertEquals(numberExpected, configurationSettingList1.size()); configurationSettingPagedFlux.toStream().forEach(configurationSetting -> configurationSettingList2.add(configurationSetting)); assertEquals(numberExpected, configurationSettingList2.size()); }
Source:
public void parserShouldReturnGlobPattern() throws Exception { Assert.assertEquals("**/*.csv", locustParser.getDefaultGlobPattern()); }

Target:
public void parserShouldReturnGlobPattern() throws Exception { assertEquals("**/*.csv", locustParser.getDefaultGlobPattern()); }
Source:
public static void pauseFlash() { Log.d(TAG, "pauseFlash()"); if (!paused && isAvailable()) { paused = true; if (isOn()) { startAgain = true; flashOff(); } } }

Target:
public static void pauseFlash() { if (!paused && isAvailable()) { paused = true; if (isOn()) { startAgain = true; flashOff(); } } }
Source:
private TVAElementType determineType(Content content) { if (content instanceof Brand) { return TVAElementType.BRAND; } if (content instanceof Series) { return TVAElementType.SERIES; } return TVAElementType.ITEM; }

Target:
private TVAElementType determineType(Content content) { if (content instanceof Brand) { return TVAElementType.BRAND; } if (content instanceof Series) { return TVAElementType.SERIES; } if (content instanceof Item) { return TVAElementType.ITEM; } throw new RuntimeException("Content " + content.getCanonicalUri() + " of unexpected type. Expected Brand/Series/Item"); }
Source:
public void execute(Context context) throws SQLException { context.execute(new AddColumnsBuilder(getDialect(), "users") .addColumn(newVarcharColumnDefBuilder() .setColumnName("homepage_type") .setIsNullable(true) .setLimit(40) .build()) .addColumn(newVarcharColumnDefBuilder() .setColumnName("homepage_value") .setIsNullable(true) .setLimit(40) .build()) .build()); }

Target:
public void execute(Context context) throws SQLException { context.execute(new AddColumnsBuilder(getDialect(), "users") .addColumn(newVarcharColumnDefBuilder() .setColumnName("homepage_type") .setIsNullable(true) .setLimit(40) .build()) .addColumn(newVarcharColumnDefBuilder() .setColumnName("homepage_parameter") .setIsNullable(true) .setLimit(40) .build()) .build()); }
Source:
private MergeOperator createMergeOperator(List<Type> sourceTypes, List<Integer> outputChannels, List<Integer> sortChannels, List<SortOrder> sortOrder) { MergeOperator.MergeOperatorFactory factory = new MergeOperator.MergeOperatorFactory( operatorId.getAndIncrement(), new PlanNodeId("plan_node_id" + operatorId.getAndIncrement()), exchangeClientFactory, serdeFactory, new SimplePageWithPositionComparator.Factory(), sourceTypes, outputChannels, sortChannels, sortOrder); DriverContext driverContext = createTaskContext(executor, executor, TEST_SESSION) .addPipelineContext(0, true, true) .addDriverContext(); return (MergeOperator) factory.createOperator(driverContext); }

Target:
private MergeOperator createMergeOperator(List<Type> sourceTypes, List<Integer> outputChannels, List<Integer> sortChannels, List<SortOrder> sortOrder) { int mergeOperatorId = operatorId.getAndIncrement(); MergeOperator.MergeOperatorFactory factory = new MergeOperator.MergeOperatorFactory( mergeOperatorId, new PlanNodeId("plan_node_id" + mergeOperatorId), exchangeClientFactory, serdeFactory, orderingCompiler, sourceTypes, outputChannels, sortChannels, sortOrder); DriverContext driverContext = createTaskContext(executor, executor, TEST_SESSION) .addPipelineContext(0, true, true) .addDriverContext(); return (MergeOperator) factory.createOperator(driverContext); }
Source:
public Query createQuery() { final int size = fieldContexts.size(); final ConversionContext conversionContext = new ContextualExceptionBridgeHelper(); if ( size == 1 ) { return queryCustomizer.setWrappedQuery( createQuery( fieldContexts.get( 0 ), conversionContext ) ).createQuery(); } else { BooleanQuery.Builder builder = new BooleanQuery.Builder(); for ( FieldContext fieldContext : fieldContexts ) { builder.add( createQuery( fieldContext, conversionContext ), BooleanClause.Occur.SHOULD ); } return queryCustomizer.setWrappedQuery( builder.build() ).createQuery(); } }

Target:
public Query createQuery() { final int size = fieldContexts.size(); final ConversionContext conversionContext = new ContextualExceptionBridgeHelper(); if ( size == 1 ) { return queryCustomizer.setWrappedQuery( createQuery( fieldContexts.get( 0 ), conversionContext ) ).createQuery(); } else { BooleanQuery.Builder aggregatedFieldsQueryBuilder = new BooleanQuery.Builder(); for ( FieldContext fieldContext : fieldContexts ) { aggregatedFieldsQueryBuilder.add( createQuery( fieldContext, conversionContext ), BooleanClause.Occur.SHOULD ); } return queryCustomizer.setWrappedQuery( aggregatedFieldsQueryBuilder.build() ).createQuery(); } }
Source:
protected <T> T doExecute(URI url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor) throws RestClientException { return retryTemplate.execute(context -> { System.out.println("Retring " + context.getRetryCount() + " " + method + " "); try { return super.doExecute(url, method, requestCallback, responseExtractor); } catch (GoodDataRestException e) { if (!failOverStrategy.retryAllowed(method.toString(), e.getStatusCode(), url)) { context.setExhaustedOnly(); } throw e; } }); }

Target:
protected <T> T doExecute(URI url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor) throws RestClientException { return retryTemplate.execute(context -> { System.out.println("Retrying " + context.getRetryCount() + " " + method + " "); try { return super.doExecute(url, method, requestCallback, responseExtractor); } catch (GoodDataRestException e) { if (!retryStrategy.retryAllowed(method.toString(), e.getStatusCode(), url)) { context.setExhaustedOnly(); } throw e; } }); }
Source:
public static PillPayloadV2 decryptedToPillPayloadVersion3(final byte[] decryptedRawMotion) throws InvalidEncryptedPayloadException { final double maxAccelerationMS2; final long cosTheta; final long motionMask; final long maxAccelerationTransform; try (final LittleEndianDataInputStream littleEndianDataInputStream = new LittleEndianDataInputStream(new ByteArrayInputStream(decryptedRawMotion))) { final byte rawMaxByte = littleEndianDataInputStream.readByte(); maxAccelerationMS2 = (UnsignedBytes.toInt(rawMaxByte) << 7) * COUNTS_IN_G; cosTheta = littleEndianDataInputStream.readByte() & 0xFFL; motionMask = littleEndianDataInputStream.readLong(); }catch (IOException ioe){ throw new InvalidEncryptedPayloadException(ioe.getMessage()); } return PillPayloadV2.createWithMotionMask((((long) (1000 * maxAccelerationMS2)) - 383) * 2, motionMask, cosTheta); }

Target:
public static PillPayloadV2 decryptedToPillPayloadVersion3(final byte[] decryptedRawMotion) throws InvalidEncryptedPayloadException { final double maxAccelerationMS2; final long cosTheta; final long motionMask; final long maxAccelerationTransform; try (final LittleEndianDataInputStream littleEndianDataInputStream = new LittleEndianDataInputStream(new ByteArrayInputStream(decryptedRawMotion))) { final byte rawMaxByte = littleEndianDataInputStream.readByte(); maxAccelerationMS2 = (UnsignedBytes.toInt(rawMaxByte) << 7) * COUNTS_IN_G; cosTheta = littleEndianDataInputStream.readByte() & 0xFFL; motionMask = littleEndianDataInputStream.readLong(); }catch (IOException ioe){ throw new InvalidEncryptedPayloadException(ioe.getMessage()); } return PillPayloadV2.createWithMotionMask((((long) (1000 * maxAccelerationMS2)) - PILL_1P5_MOTION_OFFSET) * PILL_1P5_MOTION_MULTIPLIER, motionMask, cosTheta); }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("DeleteRequest["); sb.append("BlobID=").append(blobId); sb.append("PartitionId=").append(blobId.getPartition()); sb.append(", ").append("ClientId=").append(clientId); sb.append(", ").append("CorrelationId=").append(correlationId); sb.append(", ").append("AccountId=").append(blobId.getAccountId()); sb.append(", ").append("ContainerId=").append(blobId.getContainerId()); sb.append(", ").append("DeletionTimeInMs=").append(deletionTimeInMs); sb.append("]"); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("DeleteRequest["); sb.append("BlobID=").append(blobId); sb.append(", ").append("PartitionId=").append(blobId.getPartition()); sb.append(", ").append("ClientId=").append(clientId); sb.append(", ").append("CorrelationId=").append(correlationId); sb.append(", ").append("AccountId=").append(blobId.getAccountId()); sb.append(", ").append("ContainerId=").append(blobId.getContainerId()); sb.append(", ").append("DeletionTimeInMs=").append(deletionTimeInMs); sb.append("]"); return sb.toString(); }
Source:
public void testSubmitOldStyleEvidence() throws StripeException, InterruptedException { int chargeValueCents = 100; Stripe.apiVersion = "2014-11-20"; Charge disputedCharge = createDisputedCharge(chargeValueCents); String myEvidence = "Here's evidence showing this charge is legitimate."; Dispute initialDispute = disputedCharge.getDispute(); assertNull(initialDispute.getEvidence()); assertNull(initialDispute.getEvidenceSubObject()); Map<String, Object> disputeParams = ImmutableMap.<String, Object>of("evidence", myEvidence); Dispute updatedDispute = disputedCharge.updateDispute(disputeParams); assertNotNull(updatedDispute); assertEquals(myEvidence, updatedDispute.getEvidence()); assertNull(initialDispute.getEvidenceSubObject()); }

Target:
public void testSubmitOldStyleEvidence() throws StripeException, InterruptedException { int chargeValueCents = 100; Stripe.apiVersion = "2014-11-20"; Charge disputedCharge = createDisputedCharge(chargeValueCents); String myEvidence = "Here's evidence showing this charge is legitimate."; Dispute initialDispute = disputedCharge.getDispute(); assertNull(initialDispute.getEvidence()); assertNull(initialDispute.getEvidenceSubObject()); Map<String, Object> disputeParams = ImmutableMap.<String, Object>of("evidence", myEvidence); Dispute updatedDispute = disputedCharge.updateDispute(disputeParams); assertNotNull(updatedDispute); assertEquals(myEvidence, updatedDispute.getEvidence()); assertNull(updatedDispute.getEvidenceSubObject()); }
Source:
public TextAnalyticsClientBuilder subscriptionKey(String subscriptionKey) { Objects.requireNonNull(subscriptionKey); this.subscriptionKey = subscriptionKey; this.tokenCredential = null; return this; }

Target:
public TextAnalyticsClientBuilder subscriptionKey(String subscriptionKey) { Objects.requireNonNull(subscriptionKey, "'subscriptionKey' cannot be null."); this.subscriptionKey = subscriptionKey; return this; }
Source:
public RetrieveSentences(RetrieveSentences.Args args) throws Exception { Path indexPath = Paths.get(args.index); if (!Files.exists(indexPath) || !Files.isDirectory(indexPath) || !Files.isReadable(indexPath)) { throw new IllegalArgumentException(args.index + " does not exist or is not a directory."); } this.reader = DirectoryReader.open(FSDirectory.open(indexPath)); Constructor passageClass = Class.forName("io.anserini.qa.passage." + args.scorer + "PassageScorer") .getConstructor(String.class, Integer.class); if (args.scorer.equals("Idf")) { scorer = (PassageScorer) passageClass.newInstance(args.index, args.k); } else { scorer = (PassageScorer) passageClass.newInstance(args.embeddings, args.k); } }

Target:
public RetrieveSentences(RetrieveSentences.Args args) throws Exception { Path indexPath = Paths.get(args.index); if (!Files.exists(indexPath) || !Files.isDirectory(indexPath) || !Files.isReadable(indexPath)) { throw new IllegalArgumentException(args.index + " does not exist or is not a directory."); } this.reader = DirectoryReader.open(FSDirectory.open(indexPath)); Constructor passageClass = Class.forName("io.anserini.qa.passage." + args.scorer + "PassageScorer") .getConstructor(String.class, Integer.class); if (args.scorer.equals("Idf")) { scorer = (PassageScorer) passageClass.newInstance(args.index, args.k); } else if (args.scorer.equals("Wmd")) { scorer = (PassageScorer) passageClass.newInstance(args.embeddings, args.k); } else { throw new IllegalArgumentException("Scorer should either be Idf or Wmd"); } }
Source:
private void disposeLookupSourceIfRequested() { verify(lookupSourceNotNeeded.isPresent()); if (!lookupSourceNotNeeded.get().isDone()) { return; } index.clear(); operatorContext.setRevocableMemoryReservation(0L); operatorContext.setMemoryReservation(index.getEstimatedSize().toBytes()); state = State.DISPOSED; }

Target:
private void disposeLookupSourceIfRequested() { checkState(state == State.LOOKUP_SOURCE_BUILT); verify(lookupSourceNotNeeded.isPresent()); if (!lookupSourceNotNeeded.get().isDone()) { return; } index.clear(); operatorContext.setRevocableMemoryReservation(0L); operatorContext.setMemoryReservation(index.getEstimatedSize().toBytes()); lookupSourceSupplier = null; state = State.DISPOSED; }
Source:
public void testCheckNoneOnHistoricProcessInstanceAndReadHistoryPermissionOnProcessDefinition() { processEngineConfiguration.setEnableHistoricInstancePermissions(true); String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY) .getProcessInstanceId(); createGrantAuthorization(Resources.HISTORIC_PROCESS_INSTANCE, processInstanceId, userId, HistoricProcessInstancePermissions.NONE); createGrantAuthorization(PROCESS_DEFINITION, ONE_INCIDENT_PROCESS_KEY, userId, READ_HISTORY); HistoricIncidentQuery query = historyService.createHistoricIncidentQuery(); assertThat(query.list()) .extracting("processInstanceId") .containsExactly(processInstanceId); }

Target:
public void testCheckNoneOnHistoricProcessInstanceAndReadHistoryPermissionOnProcessDefinition() { processEngineConfiguration.setEnableHistoricInstancePermissions(true); String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY) .getProcessInstanceId(); createGrantAuthorization(Resources.HISTORIC_PROCESS_INSTANCE, processInstanceId, userId, HistoricProcessInstancePermissions.NONE); createGrantAuthorization(PROCESS_DEFINITION, ONE_INCIDENT_PROCESS_KEY, userId, ProcessDefinitionPermissions.READ_HISTORY); HistoricIncidentQuery query = historyService.createHistoricIncidentQuery(); assertThat(query.list()) .extracting("processInstanceId") .containsExactly(processInstanceId); }
Source:
public static @Nullable IViewPart newView(String viewId, boolean generateSuffix) { IViewPart viewPart = null; String primaryId = null; String secondaryId = null; if (viewId.contains(TmfView.PRIMARY_SECONDARY_ID_SEPARATOR)) { int index = viewId.indexOf(TmfView.PRIMARY_SECONDARY_ID_SEPARATOR); primaryId = viewId.substring(0, index); secondaryId = getBaseSecId(viewId.substring(index + 1)); } else { primaryId = viewId; } if (generateSuffix) { if (secondaryId == null) { secondaryId = UUID.randomUUID().toString(); } else { secondaryId += INTERNAL_SECONDARY_ID_SEPARATOR + UUID.randomUUID().toString(); } } IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); IWorkbenchPage page = workbenchWindow.getActivePage(); try { viewPart = page.showView(primaryId, secondaryId, IWorkbenchPage.VIEW_ACTIVATE); page.activate(viewPart); } catch (PartInitException e) { } return viewPart; }

Target:
public static @Nullable IViewPart newView(String viewId, boolean generateSuffix) { IViewPart viewPart = null; String primaryId = null; String secondaryId = null; int index = viewId.indexOf(TmfView.PRIMARY_SECONDARY_ID_SEPARATOR); if (index != -1) { primaryId = viewId.substring(0, index); secondaryId = getBaseSecId(viewId.substring(index + 1)); } else { primaryId = viewId; } if (generateSuffix) { if (secondaryId == null) { secondaryId = UUID.randomUUID().toString(); } else { secondaryId += INTERNAL_SECONDARY_ID_SEPARATOR + UUID.randomUUID().toString(); } } IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); IWorkbenchPage page = workbenchWindow.getActivePage(); try { viewPart = page.showView(primaryId, secondaryId, IWorkbenchPage.VIEW_ACTIVATE); page.activate(viewPart); } catch (PartInitException e) { } return viewPart; }
Source:
public void testValidateFieldUnexpectedWidget() { FormField field = mock(FormField.class); IsWidget widget = mock(IsWidget.class); when(field.getWidget()).thenReturn(widget); when(field.isRequired()).thenReturn(true); try { fieldStateValidator.validate(field); fail("IllegalStateException expected"); } catch (IllegalStateException ise) { } }

Target:
public void testValidateFieldUnexpectedWidget() { FormField field = mock(FormField.class); IsWidget widget = mock(IsWidget.class); when(field.getWidget()).thenReturn(widget); when(field.isRequired()).thenReturn(true); assertThatThrownBy(() -> fieldStateValidator.validate(field)) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("Unexpected widget type: impossible to read the value"); }
Source:
private void waitForCredentialVisible(final String credUsername) { System.out.println("WaitforCredName: " + credUsername); assertTrue(waitFor().withTimeout(20, TimeUnit.SECONDS).until(() -> credentialsId.resolve().getText().contains(credUsername)) ); credentialsId.select(credUsername); }

Target:
private void waitForCredentialVisible(final String credUsername) { assertTrue(waitFor().withTimeout(5, TimeUnit.SECONDS).until(() -> credentialsId.resolve().getText().contains(credUsername)) ); credentialsId.select(credUsername); }
Source:
private boolean isConnected() { return influxDB != null; }

Target:
private boolean isConnected() { return connected; }
Source:
private void loadCache() { int retryAttempt = 0; while(true) { final GetBucketRequest request = new GetBucketRequest(bucket); request.withMaxKeys(Math.min(maxKeys, DEFAULT_MAX_KEYS)); if (prefix != null) { request.withPrefix(prefix); } if (truncated) { request.withMarker(nextMarker); } final GetBucketResponse response; try { response = this.client.getBucket(request); final ListBucketResult result = response.getListBucketResult(); truncated = result.getTruncated(); nextMarker = result.getNextMarker(); this.cache = result.getObjects(); this.cachePointer = 0; return; } catch (final IOException e) { if (retryAttempt >= retryCount) { throw new RuntimeException("Failed to get the next set of objects from the getBucket request", e); } retryAttempt++; } } }

Target:
private void loadCache() { int retryAttempt = 0; while(true) { final GetBucketRequest request = new GetBucketRequest(bucket); request.withMaxKeys(Math.min(maxKeys, DEFAULT_MAX_KEYS)); if (prefix != null) { request.withPrefix(prefix); } if (truncated) { request.withMarker(nextMarker); } final GetBucketResponse response; try { response = this.client.getBucket(request); final ListBucketResult result = response.getListBucketResult(); truncated = result.getTruncated(); nextMarker = result.getNextMarker(); this.cache = result.getObjects(); this.cachePointer = 0; return; } catch (final IOException e) { if (retryAttempt >= retryCount) { throw new RuntimeException("Failed to get the next set of objects from the getBucket request after " + retryCount + " retries", e); } retryAttempt++; } } }
Source:
private static Map<String, String> extractChallenge(String authenticateHeader, String authChallengePrefix) { if (!isValidChallenge(authenticateHeader, authChallengePrefix)) { return null; } authenticateHeader = authenticateHeader.toLowerCase().replace(authChallengePrefix.toLowerCase(), ""); String[] challenges = authenticateHeader.split(", "); Map<String, String> challengeMap = new HashMap<String, String>(); for (String pair : challenges) { String[] keyValue = pair.split("="); challengeMap.put(keyValue[0].replaceAll("\"", ""), keyValue[1].replaceAll("\"", "")); } return challengeMap; }

Target:
private static Map<String, String> extractChallenge(String authenticateHeader, String authChallengePrefix) { if (!isValidChallenge(authenticateHeader, authChallengePrefix)) { return null; } authenticateHeader = authenticateHeader.toLowerCase(Locale.ROOT).replace(authChallengePrefix.toLowerCase(Locale.ROOT), ""); String[] challenges = authenticateHeader.split(", "); Map<String, String> challengeMap = new HashMap<>(); for (String pair : challenges) { String[] keyValue = pair.split("="); challengeMap.put(keyValue[0].replaceAll("\"", ""), keyValue[1].replaceAll("\"", "")); } return challengeMap; }
Source:
private static void assertEqualsWithoutUsages(ClassSymbolImpl classSymbol) { ClassSymbolImpl copied = classSymbol.copyWithoutUsages(); assertThat(copied.hasUnresolvedTypeHierarchy()).isEqualTo(classSymbol.hasUnresolvedTypeHierarchy()); List<String> copiedfqnSuperClasses = copied.superClasses().stream().map(Symbol::fullyQualifiedName).collect(Collectors.toList()); List<String> fqnSuperClasses = classSymbol.superClasses().stream().map(Symbol::fullyQualifiedName).collect(Collectors.toList()); assertThat(copiedfqnSuperClasses).isEqualTo(fqnSuperClasses); List<Symbol.Kind> copiedKindSuperClasses = copied.superClasses().stream().map(Symbol::kind).collect(Collectors.toList()); List<Symbol.Kind> kindSuperClasses = classSymbol.superClasses().stream().map(Symbol::kind).collect(Collectors.toList()); assertThat(copiedKindSuperClasses).isEqualTo(kindSuperClasses); List<String> copiedFqnMembers = copied.declaredMembers().stream().map(Symbol::fullyQualifiedName).collect(Collectors.toList()); List<String> fqnMembers = classSymbol.declaredMembers().stream().map(Symbol::fullyQualifiedName).collect(Collectors.toList()); assertThat(copiedFqnMembers).isEqualTo(fqnMembers); List<Symbol.Kind> copiedKindMembers = copied.declaredMembers().stream().map(Symbol::kind).collect(Collectors.toList()); List<Symbol.Kind> kindMembers = classSymbol.declaredMembers().stream().map(Symbol::kind).collect(Collectors.toList()); assertThat(copiedKindMembers).isEqualTo(kindMembers); assertThat(copied.declaredMembers()).hasSize(classSymbol.declaredMembers().size()); assertThat(copied.usages()).isEmpty(); }

Target:
private static void assertEqualsWithoutUsages(ClassSymbolImpl classSymbol) { ClassSymbolImpl copied = classSymbol.copyWithoutUsages(); assertThat(copied.hasUnresolvedTypeHierarchy()).isEqualTo(classSymbol.hasUnresolvedTypeHierarchy()); List<String> copiedfqnSuperClasses = copied.superClasses().stream().map(Symbol::fullyQualifiedName).collect(Collectors.toList()); List<String> fqnSuperClasses = classSymbol.superClasses().stream().map(Symbol::fullyQualifiedName).collect(Collectors.toList()); assertThat(copiedfqnSuperClasses).isEqualTo(fqnSuperClasses); List<Symbol.Kind> copiedKindSuperClasses = copied.superClasses().stream().map(Symbol::kind).collect(Collectors.toList()); List<Symbol.Kind> kindSuperClasses = classSymbol.superClasses().stream().map(Symbol::kind).collect(Collectors.toList()); assertThat(copiedKindSuperClasses).isEqualTo(kindSuperClasses); List<String> copiedFqnMembers = copied.declaredMembers().stream().map(Symbol::fullyQualifiedName).collect(Collectors.toList()); List<String> fqnMembers = classSymbol.declaredMembers().stream().map(Symbol::fullyQualifiedName).collect(Collectors.toList()); assertThat(copiedFqnMembers).isEqualTo(fqnMembers); List<Symbol.Kind> copiedKindMembers = copied.declaredMembers().stream().map(Symbol::kind).collect(Collectors.toList()); List<Symbol.Kind> kindMembers = classSymbol.declaredMembers().stream().map(Symbol::kind).collect(Collectors.toList()); assertThat(copiedKindMembers).isEqualTo(kindMembers); assertThat(copied.usages()).isEmpty(); }
Source:
public Glide build(Context context) { if (sourceExecutor == null) { if (uncaughtThrowableStrategy != null) { sourceExecutor = GlideExecutor.newSourceExecutor(uncaughtThrowableStrategy); } sourceExecutor = GlideExecutor.newSourceExecutor(); } if (diskCacheExecutor == null) { if (uncaughtThrowableStrategy != null) { diskCacheExecutor = GlideExecutor.newDiskCacheExecutor(uncaughtThrowableStrategy); } diskCacheExecutor = GlideExecutor.newDiskCacheExecutor(); } if (memorySizeCalculator == null) { memorySizeCalculator = new MemorySizeCalculator.Builder(context).build(); } if (connectivityMonitorFactory == null) { connectivityMonitorFactory = new DefaultConnectivityMonitorFactory(); } if (bitmapPool == null) { int size = memorySizeCalculator.getBitmapPoolSize(); if (size > 0) { bitmapPool = new LruBitmapPool(size); } else { bitmapPool = new BitmapPoolAdapter(); } } if (arrayPool == null) { arrayPool = new LruArrayPool(memorySizeCalculator.getArrayPoolSizeInBytes()); } if (memoryCache == null) { memoryCache = new LruResourceCache(memorySizeCalculator.getMemoryCacheSize()); } if (diskCacheFactory == null) { diskCacheFactory = new InternalCacheDiskCacheFactory(context); } if (engine == null) { engine = new Engine(memoryCache, diskCacheFactory, diskCacheExecutor, sourceExecutor, GlideExecutor.newUnlimitedSourceExecutor()); } RequestManagerRetriever requestManagerRetriever = new RequestManagerRetriever( requestManagerFactory); return new Glide( context, engine, memoryCache, bitmapPool, arrayPool, requestManagerRetriever, connectivityMonitorFactory, logLevel, defaultRequestOptions.lock(), defaultTransitionOptions); }

Target:
public Glide build(Context context) { if (sourceExecutor == null) { sourceExecutor = GlideExecutor.newSourceExecutor(); } if (diskCacheExecutor == null) { diskCacheExecutor = GlideExecutor.newDiskCacheExecutor(); } if (memorySizeCalculator == null) { memorySizeCalculator = new MemorySizeCalculator.Builder(context).build(); } if (connectivityMonitorFactory == null) { connectivityMonitorFactory = new DefaultConnectivityMonitorFactory(); } if (bitmapPool == null) { int size = memorySizeCalculator.getBitmapPoolSize(); if (size > 0) { bitmapPool = new LruBitmapPool(size); } else { bitmapPool = new BitmapPoolAdapter(); } } if (arrayPool == null) { arrayPool = new LruArrayPool(memorySizeCalculator.getArrayPoolSizeInBytes()); } if (memoryCache == null) { memoryCache = new LruResourceCache(memorySizeCalculator.getMemoryCacheSize()); } if (diskCacheFactory == null) { diskCacheFactory = new InternalCacheDiskCacheFactory(context); } if (engine == null) { engine = new Engine(memoryCache, diskCacheFactory, diskCacheExecutor, sourceExecutor, GlideExecutor.newUnlimitedSourceExecutor()); } RequestManagerRetriever requestManagerRetriever = new RequestManagerRetriever( requestManagerFactory); return new Glide( context, engine, memoryCache, bitmapPool, arrayPool, requestManagerRetriever, connectivityMonitorFactory, logLevel, defaultRequestOptions.lock(), defaultTransitionOptions); }
Source:
public SearchQueryExecutor getExecutionPlan(SearchQuery query, Segment segment) { final QueryableIndex index = segment.asQueryableIndex(); if (index != null) { final Filter filter = Filters.convertToCNFFromQueryContext(query, Filters.toFilter(query.getDimensionsFilter())); final List<Interval> intervals = query.getQuerySegmentSpec().getIntervals(); if (intervals.size() != 1) { throw new IAE("Should only have one interval, got[%s]", intervals); } final Interval interval = intervals.get(0); final ImmutableBitmap timeFilteredBitmap = IndexOnlyExecutor.makeTimeFilteredBitmap(index, segment, filter, interval); final Iterable<DimensionSpec> dimsToSearch = SearchQueryExecutor.getDimsToSearch(index.getAvailableDimensions(), query.getDimensions()); if (filter == null || index.getDecisionHelper().hasLowCardinality(index, dimsToSearch) || index.getDecisionHelper().hasHighSelectivity(index, timeFilteredBitmap)) { log.info("Index-only execution strategy is selected"); return new IndexOnlyExecutor(query, segment); } else { log.info("Cursor-based execution strategy is selected"); return new CursorBasedExecutor(query, segment); } } else { log.info("Index doesn't exist. Fall back to cursor-based execution strategy"); return new CursorBasedExecutor(query, segment); } }

Target:
public List<SearchQueryExecutor> getExecutionPlan(SearchQuery query, Segment segment) { final QueryableIndex index = segment.asQueryableIndex(); if (index != null) { final BitmapIndexSelector selector = new ColumnSelectorBitmapIndexSelector( index.getBitmapFactoryForDimensions(), index ); if (filter == null || filter.supportsBitmapIndex(selector)) { final ImmutableBitmap timeFilteredBitmap = UseIndexesStrategy.makeTimeFilteredBitmap( index, segment, filter, interval ); final List<DimensionSpec> dimsToSearch = getDimsToSearch( index.getAvailableDimensions(), query.getDimensions() ); final SearchQueryDecisionHelper helper = getDecisionHelper(index); final double useIndexStrategyCost = helper.getBitmapIntersectCost() * computeTotalCard(index, dimsToSearch); final double cursorOnlyStrategyCost = (timeFilteredBitmap == null ? index.getNumRows() : timeFilteredBitmap.size()) * dimsToSearch.size(); log.debug("Use-index strategy cost: %f, cursor-only strategy cost: %f", useIndexStrategyCost, cursorOnlyStrategyCost ); if (useIndexStrategyCost < cursorOnlyStrategyCost) { log.debug("Use-index execution strategy is selected, query id [%s]", query.getId()); return UseIndexesStrategy.withTimeFilteredBitmap(query, timeFilteredBitmap).getExecutionPlan(query, segment); } else { log.debug("Cursor-only execution strategy is selected, query id [%s]", query.getId()); return CursorOnlyStrategy.of(query).getExecutionPlan(query, segment); } } else { log.debug( "Filter doesn't support bitmap index. Fall back to cursor-only execution strategy, query id [%s]", query.getId() ); return CursorOnlyStrategy.of(query).getExecutionPlan(query, segment); } } else { log.debug("Index doesn't exist. Fall back to cursor-only execution strategy, query id [%s]", query.getId()); return CursorOnlyStrategy.of(query).getExecutionPlan(query, segment); } }
Source:
public void delete(Path path, boolean force) throws IOException { logger.debug("Deleting in (" + path + ")..."); if (!Files.exists(path)) { logger.warn(String.format("Path not found: path-[%s]", path)); return; } RepositoryPath repositoryPath=(RepositoryPath)path; deleteMetadata(repositoryPath); super.delete(path, force); artifactEventListenerRegistry.dispatchArtifactPathDeletedEvent(path); logger.debug(String.format("Removed [%s]", path)); }

Target:
public void delete(Path path, boolean force) throws IOException { logger.debug("Deleting in (" + path + ")..."); RepositoryPath repositoryPath=(RepositoryPath)path; deleteMetadata(repositoryPath); if (!Files.exists(path)) { logger.warn(String.format("Path not found: path-[%s]", path)); return; } super.delete(path, force); artifactEventListenerRegistry.dispatchArtifactPathDeletedEvent(path); logger.debug(String.format("Removed [%s]", path)); }
Source:
public void testFilterNicsWithUnmanagedNetworksUmngmtNetRemoved(){ List<VdsNetworkInterface> existingInterfaces = new ArrayList<VdsNetworkInterface>(); for(int i=0; i<10; i++){ Nic nic = new Nic(); nic.setName("eth" + i); NetworkImplementationDetails networkImplementationDetails = new NetworkImplementationDetails(true, i%2==1); nic.setNetworkImplementationDetails(networkImplementationDetails); existingInterfaces.add(nic); } UnmanagedNetworkValidator validator = new UnmanagedNetworkValidator(); Set<String> removedUnmanagedNetworks = new HashSet<String>(); removedUnmanagedNetworks.add("eth4"); removedUnmanagedNetworks.add("eth6"); removedUnmanagedNetworks.add("eth8"); List<VdsNetworkInterface> unmanagedNicsList = validator.filterNicsWithUnmanagedNetworks(existingInterfaces, removedUnmanagedNetworks); assertEquals(2, unmanagedNicsList.size()); for(int i=0; i<2; i++){ assertEquals("eth" + (i*2), unmanagedNicsList.get(i).getName()); } }

Target:
public void testFilterNicsWithUnmanagedNetworksUmngmtNetRemoved(){ VdsNetworkInterface nicWithUnmanagedToBeRemoved = createNicWithNetworkImplementationDetails("eth_unmanaged1_toBeRemoved", false); VdsNetworkInterface nicWithUnmanaged = createNicWithNetworkImplementationDetails("eth_unmanaged", false); VdsNetworkInterface nicWithManagedToBeRemoved = createNicWithNetworkImplementationDetails("eth_managed_toBeRemoved", true); VdsNetworkInterface nicWithManaged = createNicWithNetworkImplementationDetails("eth_managed", true); List<VdsNetworkInterface> existingInterfaces = Arrays.asList(nicWithUnmanagedToBeRemoved, nicWithUnmanaged, nicWithManagedToBeRemoved, nicWithManaged); Set<String> removedUnmanagedNetworks = new HashSet<>(Arrays.asList("eth_unmanaged1_toBeRemoved", "eth_managed_toBeRemoved")); List<VdsNetworkInterface> unmanagedNicsList = validator.filterNicsWithUnmanagedNetworks(existingInterfaces, removedUnmanagedNetworks); assertEquals(1, unmanagedNicsList.size()); assertEquals("eth_unmanaged", unmanagedNicsList.get(0).getName()); }
Source:
public <B> Trampoline<B> bind(final F<A, Trampoline<B>> f) { return codense(sub, o -> suspend(new P1<Trampoline<B>>() { public Trampoline<B> _1() { return cont.f(o).bind(f); } })); }

Target:
public <B> Trampoline<B> bind(final F<A, Trampoline<B>> f) { return codense(sub, o -> suspend(P.lazy(u -> cont.f(o).bind(f)))); }