nus-yam/ex-repair huggingface dataset:
Program: 130789
Project: 130789
Buggy source:
@Override public void operationComplete(ChannelFuture cfuture){
  if (cfuture.isSuccess()) {
    LOG.debug("String_Node_Str",destination);
    Message msg=MessageBuilder.buildHandshake(source);
    ByteBuffer bb=ByteBuffer.wrap(msg.toByteArray());
    channel=cfuture.channel();
    channel.writeAndFlush(Unpooled.wrappedBuffer(bb));
  }
 else {
    LOG.debug("String_Node_Str",destination,cfuture.cause());
    handshakeFailed();
  }
}

Fixed version (ground truth):
@Override public void operationComplete(ChannelFuture cfuture){
  if (cfuture.isSuccess()) {
    LOG.debug("String_Node_Str",hostPort,destination);
    Message msg=MessageBuilder.buildHandshake(hostPort);
    ByteBuffer bb=ByteBuffer.wrap(msg.toByteArray());
    channel=cfuture.channel();
    channel.writeAndFlush(Unpooled.wrappedBuffer(bb));
  }
 else {
    LOG.debug("String_Node_Str",destination,cfuture.cause());
    handshakeFailed();
  }
}
Program: 130790
Project: 130790
Buggy source:
/** 
 * Goes to the next transaction record.
 * @return the next transaction record
 * @throws java.io.EOFException if it reaches the end of file before readingthe entire transaction.
 * @throws IOException in case of IO failure
 * @throws NoSuchElementException if there's no more elements to get
 */
@Override public Transaction next() throws IOException {
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  DataInputStream in=new DataInputStream(logStream);
  int epoch, xid;
  epoch=in.readInt();
  xid=in.readInt();
  Zxid zxid=new Zxid(epoch,xid);
  int bodyLength=in.readInt();
  byte[] bodyBuffer=new byte[bodyLength];
  in.readFully(bodyBuffer,0,bodyLength);
  this.lastTransactionLength=Zxid.getZxidLength() + 4 + bodyLength;
  this.position+=this.lastTransactionLength;
  return new Transaction(zxid,bodyBuffer);
}

Fixed version (ground truth):
/** 
 * Goes to the next transaction record.
 * @return the next transaction record
 * @throws java.io.EOFException if it reaches the end of file before readingthe entire transaction.
 * @throws IOException in case of IO failure
 * @throws NoSuchElementException if there's no more elements to get
 */
@Override public Transaction next() throws IOException {
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  DataInputStream in=new DataInputStream(logStream);
  int epoch, xid;
  epoch=in.readInt();
  xid=in.readInt();
  Zxid zxid=new Zxid(epoch,xid);
  int bodyLength=in.readInt();
  byte[] bodyBuffer=new byte[bodyLength];
  in.readFully(bodyBuffer,0,bodyLength);
  this.lastTransactionLength=Zxid.getZxidLength() + 4 + bodyLength;
  this.position+=this.lastTransactionLength;
  return new Transaction(zxid,ByteBuffer.wrap(bodyBuffer));
}
Program: 130791
Project: 130791
Buggy source:
/** 
 * Appends a request to transaction log.
 * @param txn the transaction which will be added to log.
 * @throws IOException in case of IO failure
 */
@Override public void append(Transaction txn) throws IOException {
  if (txn.getZxid().compareTo(this.lastZxidSeen) <= 0) {
    LOG.error("String_Node_Str",txn.getZxid(),this.lastZxidSeen);
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  try {
    this.logStream.writeInt(txn.getZxid().getEpoch());
    this.logStream.writeInt(txn.getZxid().getXid());
    this.logStream.writeInt(txn.getBody().length);
    this.logStream.write(txn.getBody());
    this.logStream.flush();
    this.lastZxidSeen=txn.getZxid();
  }
 catch (  IOException e) {
    this.logStream.close();
  }
}

Fixed version (ground truth):
/** 
 * Appends a request to transaction log.
 * @param txn the transaction which will be added to log.
 * @throws IOException in case of IO failure
 */
@Override public void append(Transaction txn) throws IOException {
  if (txn.getZxid().compareTo(this.lastZxidSeen) <= 0) {
    LOG.error("String_Node_Str",txn.getZxid(),this.lastZxidSeen);
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  try {
    ByteBuffer buf=txn.getBody();
    this.logStream.writeInt(txn.getZxid().getEpoch());
    this.logStream.writeInt(txn.getZxid().getXid());
    this.logStream.writeInt(buf.remaining());
    while (buf.hasRemaining()) {
      this.logStream.writeByte(buf.get());
    }
    this.logStream.flush();
    this.lastZxidSeen=txn.getZxid();
  }
 catch (  IOException e) {
    this.logStream.close();
  }
}
Program: 130792
Project: 130792
Buggy source:
public Transaction(Zxid zxid,byte[] body){
  this.zxid=zxid;
  this.body=body;
}

Fixed version (ground truth):
public Transaction(Zxid zxid,ByteBuffer body){
  this.zxid=zxid;
  this.body=body;
}
Program: 130793
Project: 130793
Buggy source:
/** 
 * Get the body of the transaction.
 * @return an array of bytes representing the body of the transaction
 */
public byte[] getBody(){
  return this.body;
}

Fixed version (ground truth):
/** 
 * Get the body of the transaction.
 * @return an array of bytes representing the body of the transaction
 */
public ByteBuffer getBody(){
  return this.body;
}
Program: 130794
Project: 130794
Buggy source:
@Test public void testReopenFile() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,0),"String_Node_Str".getBytes()));
  log.close();
  log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,1),"String_Node_Str".getBytes()));
  Log.LogIterator iter=log.getIterator(new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(0,1));
}

Fixed version (ground truth):
@Test public void testReopenFile() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,0),ByteBuffer.wrap("String_Node_Str".getBytes())));
  log.close();
  log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,1),ByteBuffer.wrap("String_Node_Str".getBytes())));
  Log.LogIterator iter=log.getIterator(new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(0,1));
}
Program: 130795
Project: 130795
Buggy source:
/** 
 * Appending a transaction with a zxid smaller than the previous zxid should result in a RuntimeException.
 */
@Test(expected=RuntimeException.class) public void testAppendSmallerZxid() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,1),"String_Node_Str".getBytes()));
  log.append(new Transaction(new Zxid(0,0),"String_Node_Str".getBytes()));
}

Fixed version (ground truth):
/** 
 * Appending a transaction with a zxid smaller than the previous zxid should result in a RuntimeException.
 */
@Test(expected=RuntimeException.class) public void testAppendSmallerZxid() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,1),ByteBuffer.wrap("String_Node_Str".getBytes())));
  log.append(new Transaction(new Zxid(0,0),ByteBuffer.wrap("String_Node_Str".getBytes())));
}
Program: 130796
Project: 130796
Buggy source:
/** 
 * Appending a transaction with a zxid equal to the previous zxid should result in a RuntimeException.
 */
@Test(expected=RuntimeException.class) public void testAppendSameZxid() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,0),"String_Node_Str".getBytes()));
  log.append(new Transaction(new Zxid(0,0),"String_Node_Str".getBytes()));
}

Fixed version (ground truth):
/** 
 * Appending a transaction with a zxid equal to the previous zxid should result in a RuntimeException.
 */
@Test(expected=RuntimeException.class) public void testAppendSameZxid() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,0),ByteBuffer.wrap("String_Node_Str".getBytes())));
  log.append(new Transaction(new Zxid(0,0),ByteBuffer.wrap("String_Node_Str".getBytes())));
}
Program: 130797
Project: 130797
Buggy source:
private SimpleLog initLog() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,0),"String_Node_Str".getBytes()));
  log.append(new Transaction(new Zxid(0,1),"String_Node_Str".getBytes()));
  log.append(new Transaction(new Zxid(0,2),"String_Node_Str".getBytes()));
  log.append(new Transaction(new Zxid(0,3),"String_Node_Str".getBytes()));
  return log;
}

Fixed version (ground truth):
private SimpleLog initLog() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,0),ByteBuffer.wrap("String_Node_Str".getBytes())));
  log.append(new Transaction(new Zxid(0,1),ByteBuffer.wrap("String_Node_Str".getBytes())));
  log.append(new Transaction(new Zxid(0,2),ByteBuffer.wrap("String_Node_Str".getBytes())));
  log.append(new Transaction(new Zxid(0,3),ByteBuffer.wrap("String_Node_Str".getBytes())));
  return log;
}
Program: 130798
Project: 130798
Buggy source:
@Test public void testAppend() throws IOException {
  SimpleLog log=initLog();
  Log.LogIterator iter=log.getIterator(new Zxid(0,1));
  Transaction txn=iter.next();
  Assert.assertEquals(txn.getZxid(),new Zxid(0,1));
  Assert.assertTrue(Arrays.equals(txn.getBody(),"String_Node_Str".getBytes()));
  txn=iter.next();
  Assert.assertEquals(txn.getZxid(),new Zxid(0,2));
  Assert.assertTrue(Arrays.equals(txn.getBody(),"String_Node_Str".getBytes()));
  txn=iter.next();
  Assert.assertEquals(txn.getZxid(),new Zxid(0,3));
  Assert.assertTrue(Arrays.equals(txn.getBody(),"String_Node_Str".getBytes()));
  Assert.assertFalse(iter.hasNext());
}

Fixed version (ground truth):
@Test public void testAppend() throws IOException {
  SimpleLog log=initLog();
  Log.LogIterator iter=log.getIterator(new Zxid(0,1));
  Transaction txn=iter.next();
  Assert.assertEquals(txn.getZxid(),new Zxid(0,1));
  Assert.assertTrue(txn.getBody().equals(ByteBuffer.wrap("String_Node_Str".getBytes())));
  txn=iter.next();
  Assert.assertEquals(txn.getZxid(),new Zxid(0,2));
  Assert.assertTrue(txn.getBody().equals(ByteBuffer.wrap("String_Node_Str".getBytes())));
  txn=iter.next();
  Assert.assertEquals(txn.getZxid(),new Zxid(0,3));
  Assert.assertTrue(txn.getBody().equals(ByteBuffer.wrap("String_Node_Str".getBytes())));
  Assert.assertFalse(iter.hasNext());
}
Program: 130799
Project: 130799
Buggy source:
@Test public void testTruncateAndAppend() throws IOException {
  SimpleLog log=initLog();
  log.truncate(new Zxid(0,0));
  log.append(new Transaction(new Zxid(1,2),"String_Node_Str".getBytes()));
  Log.LogIterator iter=log.getIterator(new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(1,2));
}

Fixed version (ground truth):
@Test public void testTruncateAndAppend() throws IOException {
  SimpleLog log=initLog();
  log.truncate(new Zxid(0,0));
  log.append(new Transaction(new Zxid(1,2),ByteBuffer.wrap("String_Node_Str".getBytes())));
  Log.LogIterator iter=log.getIterator(new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(1,2));
}
Program: 130800
Project: 130800
Buggy source:
@Test public void testAppendWithoutSync() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,0),"String_Node_Str".getBytes()));
  Log.LogIterator iter=log.getIterator(new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(0,0));
}

Fixed version (ground truth):
@Test public void testAppendWithoutSync() throws IOException {
  File temp=File.createTempFile(LOGFILE,"String_Node_Str");
  SimpleLog log=new SimpleLog(temp);
  log.append(new Transaction(new Zxid(0,0),ByteBuffer.wrap("String_Node_Str".getBytes())));
  Log.LogIterator iter=log.getIterator(new Zxid(0,0));
  Assert.assertEquals(iter.next().getZxid(),new Zxid(0,0));
}
Program: 130801
Project: 130801
Buggy source:
public AttributeDefinition getAttribute(){
  return attribute;
}

Fixed version (ground truth):
public AttributeDefinitionDraft getAttribute(){
  return attribute;
}
Program: 130802
Project: 130802
Buggy source:
public static AddAttributeDefinition of(final AttributeDefinition attributeDefinition){
  return new AddAttributeDefinition(attributeDefinition);
}

Fixed version (ground truth):
public static AddAttributeDefinition of(final AttributeDefinitionDraft attributeDefinitionDraft){
  return new AddAttributeDefinition(attributeDefinitionDraft);
}
Program: 130803
Project: 130803
Buggy source:
private AddAttributeDefinition(final AttributeDefinition attributeDefinition){
  super("String_Node_Str");
  this.attribute=attributeDefinition;
}

Fixed version (ground truth):
private AddAttributeDefinition(final AttributeDefinitionDraft attributeDefinition){
  super("String_Node_Str");
  this.attribute=attributeDefinition;
}
Program: 130804
Project: 130804
Buggy source:
Price getPrice();

Fixed version (ground truth):
PriceDraft getPrice();
Program: 130805
Project: 130805
Buggy source:
private LineItemImportDraftBuilder(final ProductVariantImportDraft variant,final Long quantity,final Price price,@Nullable final String productId,final LocalizedString name){
  this.price=price;
  this.variant=variant;
  this.quantity=quantity;
  this.productId=productId;
  this.name=name;
}

Fixed version (ground truth):
private LineItemImportDraftBuilder(final ProductVariantImportDraft variant,final Long quantity,final PriceDraft price,@Nullable final String productId,final LocalizedString name){
  this.price=price;
  this.variant=variant;
  this.quantity=quantity;
  this.productId=productId;
  this.name=name;
}
Program: 130806
Project: 130806
Buggy source:
public LineItemImportDraftBuilder price(final Price price){
  this.price=price;
  return this;
}

Fixed version (ground truth):
public LineItemImportDraftBuilder price(final PriceDraft price){
  this.price=price;
  return this;
}
Program: 130807
Project: 130807
Buggy source:
public static LineItemImportDraftBuilder of(final ProductVariantImportDraft variant,final long quantity,final Price price,final LocalizedString name){
  return new LineItemImportDraftBuilder(variant,quantity,price,variant.getProductId(),name);
}

Fixed version (ground truth):
/** 
 * @deprecated use LineItemImportDraftBuilder{@link #of(ProductVariantImportDraft,long,PriceDraft,LocalizedString)} instead.
 */
@Deprecated public static LineItemImportDraftBuilder of(final ProductVariantImportDraft variant,final long quantity,final Price price,final LocalizedString name){
  return new LineItemImportDraftBuilder(variant,quantity,PriceDraft.of(price),variant.getProductId(),name);
}
Program: 130808
Project: 130808
Buggy source:
public LineItemImportDraftImpl(final LocalizedString name,@Nullable final String productId,final ProductVariantImportDraft variant,final Price price,final Long quantity,@Nullable final Set<ItemState> state,@Nullable final Reference<Channel> supplyChannel,@Nullable final TaxRate taxRate,@Nullable final CustomFieldsDraft custom,@Nullable final ItemShippingDetailsDraft shippingDetails){
  this.name=name;
  this.productId=productId;
  this.variant=variant;
  this.price=price;
  this.quantity=quantity;
  this.state=state;
  this.supplyChannel=supplyChannel;
  this.taxRate=taxRate;
  this.custom=custom;
  this.shippingDetails=shippingDetails;
}

Fixed version (ground truth):
public LineItemImportDraftImpl(final LocalizedString name,@Nullable final String productId,final ProductVariantImportDraft variant,final PriceDraft price,final Long quantity,@Nullable final Set<ItemState> state,@Nullable final Reference<Channel> supplyChannel,@Nullable final TaxRate taxRate,@Nullable final CustomFieldsDraft custom,@Nullable final ItemShippingDetailsDraft shippingDetails){
  this.name=name;
  this.productId=productId;
  this.variant=variant;
  this.price=price;
  this.quantity=quantity;
  this.state=state;
  this.supplyChannel=supplyChannel;
  this.taxRate=taxRate;
  this.custom=custom;
  this.shippingDetails=shippingDetails;
}
Program: 130809
Project: 130809
Buggy source:
@Override public Price getPrice(){
  return price;
}

Fixed version (ground truth):
@Override public PriceDraft getPrice(){
  return price;
}
Program: 130810
Project: 130810
Buggy source:
@Nullable List<Price> getPrices();

Fixed version (ground truth):
@Nullable List<PriceDraft> getPrices();
Program: 130811
Project: 130811
Buggy source:
/** 
 * The prices of the variant. The prices should not contain two prices for the same price scope (same currency, country and customer group). If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.
 * @param prices the prices to set
 * @return this builder
 */
public ProductVariantImportDraftBuilder prices(@Nullable final List<Price> prices){
  this.prices=prices;
  return this;
}

Fixed version (ground truth):
/** 
 * The prices of the variant. The prices should not contain two prices for the same price scope (same currency, country and customer group). If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.
 * @param prices the prices to set
 * @return this builder
 */
public ProductVariantImportDraftBuilder prices(@Nullable final List<Price> prices){
  this.prices=Optional.ofNullable(prices).map(prices1 -> prices1.stream().map(PriceDraft::of).map(PriceDraft.class::cast).collect(Collectors.toList())).orElse(null);
  return this;
}
Program: 130812
Project: 130812
Buggy source:
ProductVariantImportDraftImpl(@Nullable final Integer id,@Nullable final String sku,@Nullable final List<Price> prices,@Nullable final List<Image> images,@Nullable final List<AttributeImportDraft> attributes,@Nullable final String productId){
  this.attributes=attributes;
  this.id=id;
  this.sku=sku;
  this.prices=prices;
  this.images=images;
  this.productId=productId;
}

Fixed version (ground truth):
ProductVariantImportDraftImpl(@Nullable final Integer id,@Nullable final String sku,@Nullable final List<PriceDraft> prices,@Nullable final List<Image> images,@Nullable final List<AttributeImportDraft> attributes,@Nullable final String productId){
  this.attributes=attributes;
  this.id=id;
  this.sku=sku;
  this.prices=prices;
  this.images=images;
  this.productId=productId;
}
Program: 130813
Project: 130813
Buggy source:
@Nullable @Override public List<Price> getPrices(){
  return prices;
}

Fixed version (ground truth):
@Nullable @Override public List<PriceDraft> getPrices(){
  return prices;
}
Program: 130814
Project: 130814
Buggy source:
@Test public void createsLineImportDraft(){
  final String productId="String_Node_Str";
  final ProductVariantImportDraft variant=ProductVariantImportDraftBuilder.of(productId,1).attributes(AttributeImportDraft.of("String_Node_Str",yellow),AttributeImportDraft.of("String_Node_Str",EURO_30)).build();
  final int quantity=1;
  final Price price=Price.of(EURO_1);
  final LocalizedString name=en("String_Node_Str");
  final Set<ItemState> state=asSet(ItemState.of(State.referenceOfId("String_Node_Str"),2));
  final Reference<Channel> supplyChannel=Channel.referenceOfId("String_Node_Str");
  final CustomFieldsDraft custom=CustomFieldsDraftBuilder.ofTypeId("String_Node_Str").build();
  final LineItemImportDraftBuilder lineItemImportDraftBuilder=LineItemImportDraftBuilder.of(variant,quantity,price,name).state(state).supplyChannel(supplyChannel).custom(custom);
  final LineItemImportDraft lineItemImportDraft=lineItemImportDraftBuilder.build();
  assertThat(lineItemImportDraft.getName()).isEqualTo(name);
  assertThat(lineItemImportDraft.getProductId()).isEqualTo(productId);
  assertThat(lineItemImportDraft.getVariant()).isEqualTo(variant);
  assertThat(lineItemImportDraft.getPrice()).isEqualTo(price);
  assertThat(lineItemImportDraft.getQuantity()).isEqualTo(quantity);
  assertThat(lineItemImportDraft.getState()).isEqualTo(state);
  assertThat(lineItemImportDraft.getSupplyChannel()).isEqualTo(supplyChannel);
  assertThat(lineItemImportDraft.getCustom()).isEqualTo(custom);
}

Fixed version (ground truth):
@Test public void createsLineImportDraft(){
  final String productId="String_Node_Str";
  final ProductVariantImportDraft variant=ProductVariantImportDraftBuilder.of(productId,1).attributes(AttributeImportDraft.of("String_Node_Str",yellow),AttributeImportDraft.of("String_Node_Str",EURO_30)).build();
  final int quantity=1;
  final Price price=Price.of(EURO_1);
  final LocalizedString name=en("String_Node_Str");
  final Set<ItemState> state=asSet(ItemState.of(State.referenceOfId("String_Node_Str"),2));
  final Reference<Channel> supplyChannel=Channel.referenceOfId("String_Node_Str");
  final CustomFieldsDraft custom=CustomFieldsDraftBuilder.ofTypeId("String_Node_Str").build();
  final LineItemImportDraftBuilder lineItemImportDraftBuilder=LineItemImportDraftBuilder.of(variant,quantity,price,name).state(state).supplyChannel(supplyChannel).custom(custom);
  final LineItemImportDraft lineItemImportDraft=lineItemImportDraftBuilder.build();
  assertThat(lineItemImportDraft.getName()).isEqualTo(name);
  assertThat(lineItemImportDraft.getProductId()).isEqualTo(productId);
  assertThat(lineItemImportDraft.getVariant()).isEqualTo(variant);
  assertThat(lineItemImportDraft.getPrice()).isEqualTo(PriceDraft.of(price));
  assertThat(lineItemImportDraft.getQuantity()).isEqualTo(quantity);
  assertThat(lineItemImportDraft.getState()).isEqualTo(state);
  assertThat(lineItemImportDraft.getSupplyChannel()).isEqualTo(supplyChannel);
  assertThat(lineItemImportDraft.getCustom()).isEqualTo(custom);
}
Program: 130816
Project: 130816
Buggy source:
/** 
 * The prices of the variant. The prices should not contain two prices for the same price scope (same currency, country and customer group). If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.
 * @param prices the prices to set
 * @return this builder
 */
public ProductVariantImportDraftBuilder prices(@Nullable final List<Price> prices){
  this.prices=Optional.ofNullable(prices).map(prices1 -> prices1.stream().map(PriceDraft::of).map(PriceDraft.class::cast).collect(Collectors.toList())).orElse(null);
  return this;
}

Fixed version (ground truth):
/** 
 * The prices of the variant. The prices should not contain two prices for the same price scope (same currency, country and customer group). If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.
 * @param prices the prices to set
 * @return this builder
 */
public ProductVariantImportDraftBuilder prices(@Nullable final List<PriceDraft> prices){
  this.prices=prices;
  return this;
}
Program: 130819
Project: 130819
Buggy source:
@Test public void customLineItems() throws Exception {
  withTransientTaxCategory(client(),taxCategory -> withProduct(client(),product -> {
    final LocalizedString name=randomSlug();
    final long quantity=16;
    final MonetaryAmount money=EURO_20;
    final Reference<TaxCategory> taxCategoryReference=defaultTaxCategory(client()).toReference();
    final String id="String_Node_Str";
    final String slug="String_Node_Str";
    final TaxRate taxRate=taxCategory.getTaxRates().get(0);
    final CustomLineItemImportDraft customLineItem=CustomLineItemImportDraftBuilder.of(name,quantity,money,taxCategoryReference).id(id).slug(slug).taxRate(taxRate).build();
    final List<CustomLineItemImportDraft> customLineItems=asList(customLineItem);
    testOrderAspect(builder -> builder.customLineItems(customLineItems),order -> {
      assertThat(order.getCustomLineItems()).hasSize(1);
      final CustomLineItem actual=order.getCustomLineItems().get(0);
      assertThat(actual.getMoney()).isEqualTo(money);
      assertThat(actual.getQuantity()).isEqualTo(quantity);
      assertThat(actual.getName()).isEqualTo(name);
      assertThat(actual.getSlug()).isEqualTo(slug);
      assertThat(actual.getTaxCategory()).isEqualTo(taxCategoryReference);
      assertThat(actual.getTaxRate()).isEqualTo(taxRate);
    }
);
  }
));
}

Fixed version (ground truth):
@Test public void customLineItems() throws Exception {
  withUpdateableType(client(),type -> {
    withTransientTaxCategory(client(),taxCategory -> withProduct(client(),product -> {
      final LocalizedString name=randomSlug();
      final long quantity=16;
      final MonetaryAmount money=EURO_20;
      final Reference<TaxCategory> taxCategoryReference=defaultTaxCategory(client()).toReference();
      final String id="String_Node_Str";
      final String slug="String_Node_Str";
      final TaxRate taxRate=taxCategory.getTaxRates().get(0);
      final String value="String_Node_Str";
      final PriceDraft price=PriceDraft.of(EURO_1).withCustom(CustomFieldsDraft.ofTypeIdAndObjects(type.getId(),singletonMap(STRING_FIELD_NAME,value)));
      final CustomLineItemImportDraft customLineItem=CustomLineItemImportDraftBuilder.of(name,quantity,money,taxCategoryReference).id(id).slug(slug).taxRate(taxRate).build();
      final List<CustomLineItemImportDraft> customLineItems=asList(customLineItem);
      testOrderAspect(builder -> builder.customLineItems(customLineItems),order -> {
        assertThat(order.getCustomLineItems()).hasSize(1);
        final CustomLineItem actual=order.getCustomLineItems().get(0);
        assertThat(actual.getMoney()).isEqualTo(money);
        assertThat(actual.getQuantity()).isEqualTo(quantity);
        assertThat(actual.getName()).isEqualTo(name);
        assertThat(actual.getSlug()).isEqualTo(slug);
        assertThat(actual.getTaxCategory()).isEqualTo(taxCategoryReference);
        assertThat(actual.getTaxRate()).isEqualTo(taxRate);
      }
);
    }
));
    return type;
  }
);
}
Program: 130820
Project: 130820
Buggy source:
@BeforeClass public static void clean(){
  client().executeBlocking(CartDiscountQuery.of().withPredicates(m -> m.name().locale(ENGLISH).is("String_Node_Str"))).getResults().forEach(discount -> client().executeBlocking(CartDiscountDeleteCommand.of(discount)));
}

Fixed version (ground truth):
@BeforeClass public static void clean(){
  deleteDiscountCodesAndCartDiscounts(client());
  client().executeBlocking(CartDiscountQuery.of().withPredicates(m -> m.name().locale(ENGLISH).is("String_Node_Str"))).getResults().forEach(discount -> client().executeBlocking(CartDiscountDeleteCommand.of(discount)));
}
Program: 130821
Project: 130821
Buggy source:
@BeforeClass public static void cleanUp() throws Exception {
  ProductFixtures.deleteProductsAndProductTypes(client());
}

Fixed version (ground truth):
@BeforeClass public static void cleanUp() throws Exception {
  CartDiscountFixtures.deleteDiscountCodesAndCartDiscounts(client());
  ProductFixtures.deleteProductsAndProductTypes(client());
}
Program: 130822
Project: 130822
Buggy source:
@BeforeClass public static void setUp() throws Exception {
  ProductFixtures.deleteProductsAndProductTypes(client());
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws Exception {
  CartDiscountFixtures.deleteDiscountCodesAndCartDiscounts(client());
  ProductFixtures.deleteProductsAndProductTypes(client());
}
Program: 130823
Project: 130823
Buggy source:
@AfterClass public static void delete(){
  ProductFixtures.deleteProductsAndProductTypes(client());
  productType=null;
}

Fixed version (ground truth):
@AfterClass public static void delete(){
  CartDiscountFixtures.deleteDiscountCodesAndCartDiscounts(client());
  ProductFixtures.deleteProductsAndProductTypes(client());
  productType=null;
}
Program: 130824
Project: 130824
Buggy source:
@AfterClass public static void delete(){
  ProductFixtures.deleteProductsAndProductTypes(client());
  productType=null;
}

Fixed version (ground truth):
@AfterClass public static void delete(){
  CartDiscountFixtures.deleteDiscountCodesAndCartDiscounts(client());
  ProductFixtures.deleteProductsAndProductTypes(client());
  productType=null;
}
Program: 130825
Project: 130825
Buggy source:
@AfterClass public static void cleanUp(){
  ReviewFixtures.deleteReviews(client());
  ProductFixtures.deleteProductsAndProductTypes(client());
}

Fixed version (ground truth):
@AfterClass public static void cleanUp(){
  CartDiscountFixtures.deleteDiscountCodesAndCartDiscounts(client());
  ReviewFixtures.deleteReviews(client());
  ProductFixtures.deleteProductsAndProductTypes(client());
}
Program: 130826
Project: 130826
Buggy source:
private static AssetDraft getAssetDraft1(){
  final AssetSource assetSource1=AssetSourceBuilder.ofUri("String_Node_Str").key(randomKey()).contentType("String_Node_Str").dimensionsOfWidthAndHeight(1934,1115).build();
  final LocalizedString name=LocalizedString.ofEnglish("String_Node_Str");
  final LocalizedString description=LocalizedString.ofEnglish("String_Node_Str");
  return AssetDraftBuilder.of(singletonList(assetSource1),name).description(description).tags("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").build();
}

Fixed version (ground truth):
private static AssetDraft getAssetDraft1(){
  final AssetSource assetSource1=AssetSourceBuilder.ofUri("String_Node_Str").key(randomKey()).contentType("String_Node_Str").dimensionsOfWidthAndHeight(1934,1115).build();
  final LocalizedString name=LocalizedString.ofEnglish("String_Node_Str");
  final LocalizedString description=LocalizedString.ofEnglish("String_Node_Str");
  return AssetDraftBuilder.of(singletonList(assetSource1),name).key("String_Node_Str").description(description).tags("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").build();
}
Program: 130827
Project: 130827
Buggy source:
private static AssetDraft getAssetDraft2(){
  final AssetSource assetSource1=AssetSourceBuilder.ofUri("String_Node_Str").key(randomKey()).contentType("String_Node_Str").build();
  final LocalizedString name=LocalizedString.ofEnglish("String_Node_Str");
  return AssetDraftBuilder.of(singletonList(assetSource1),name).tags("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").build();
}

Fixed version (ground truth):
private static AssetDraft getAssetDraft2(){
  final AssetSource assetSource1=AssetSourceBuilder.ofUri("String_Node_Str").key(randomKey()).contentType("String_Node_Str").build();
  final LocalizedString name=LocalizedString.ofEnglish("String_Node_Str");
  return AssetDraftBuilder.of(singletonList(assetSource1),name).key("String_Node_Str").tags("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").build();
}
Program: 130828
Project: 130828
Buggy source:
@Override public JsonNode serialize(final T t){
  return mapper().valueToTree(t.getKey());
}

Fixed version (ground truth):
@Override public JsonNode serialize(final T t){
  return mapper().valueToTree(t);
}
Program: 130829
Project: 130829
Buggy source:
DiscountCodeDraftBuilder(final Boolean active,final List<Reference<CartDiscount>> cartDiscounts,final @Nullable String cartPredicate,final String code,final @Nullable CustomFieldsDraft custom,final @Nullable LocalizedString description,final @Nullable Long maxApplications,final @Nullable Long maxApplicationsPerCustomer,final @Nullable LocalizedString name){
  super(active,cartDiscounts,cartPredicate,code,custom,description,maxApplications,maxApplicationsPerCustomer,name);
}

Fixed version (ground truth):
DiscountCodeDraftBuilder(final Boolean active,final List<Reference<CartDiscount>> cartDiscounts,final @Nullable String cartPredicate,final String code,final @Nullable CustomFieldsDraft custom,final @Nullable LocalizedString description,final @Nullable Long maxApplications,final @Nullable Long maxApplicationsPerCustomer,final @Nullable LocalizedString name,@Nullable final ZonedDateTime validFrom,@Nullable final ZonedDateTime validUntil){
  super(active,cartDiscounts,cartPredicate,code,custom,description,maxApplications,maxApplicationsPerCustomer,name,validFrom,validUntil);
}
Program: 130830
Project: 130830
Buggy source:
DiscountCodeDraftDsl(final Boolean active,final List<Reference<CartDiscount>> cartDiscounts,final @Nullable String cartPredicate,final String code,final @Nullable CustomFieldsDraft custom,final @Nullable LocalizedString description,final @Nullable Long maxApplications,final @Nullable Long maxApplicationsPerCustomer,final @Nullable LocalizedString name){
  super(active,cartDiscounts,cartPredicate,code,custom,description,maxApplications,maxApplicationsPerCustomer,name);
}

Fixed version (ground truth):
DiscountCodeDraftDsl(final Boolean active,final List<Reference<CartDiscount>> cartDiscounts,final @Nullable String cartPredicate,final String code,final @Nullable CustomFieldsDraft custom,final @Nullable LocalizedString description,final @Nullable Long maxApplications,final @Nullable Long maxApplicationsPerCustomer,final @Nullable LocalizedString name,@Nullable final ZonedDateTime validFrom,@Nullable final ZonedDateTime validUntil){
  super(active,cartDiscounts,cartPredicate,code,custom,description,maxApplications,maxApplicationsPerCustomer,name,validFrom,validUntil);
}
Program: 130833
Project: 130833
Buggy source:
@Test public void changePaymentState() throws Exception {
  withNonUpdatedOrder(client(),order -> {
    final PaymentState newState=PaymentState.PAID;
    assertThat(order.getPaymentState()).isNotEqualTo(newState);
    final Order updatedOrder=client().executeBlocking(OrderUpdateCommand.of(order,ChangePaymentState.of(newState)));
    assertThat(updatedOrder.getPaymentState()).isEqualTo(newState);
    final Query<OrderPaymentStateChangedMessage> query=MessageQuery.of().withPredicates(m -> m.resource().id().is(updatedOrder.getId())).withSort(m -> m.createdAt().sort().desc()).withExpansionPaths(m -> m.resource()).withLimit(1L).forMessageType(OrderPaymentStateChangedMessage.MESSAGE_HINT);
    assertEventually(() -> {
      final PagedQueryResult<OrderPaymentStateChangedMessage> pagedQueryResult=client().executeBlocking(query);
      final Optional<OrderPaymentStateChangedMessage> optMessage=pagedQueryResult.head();
      assertThat(optMessage).isPresent();
      OrderPaymentStateChangedMessage message=optMessage.get();
      assertThat(message.getId()).isEqualTo(updatedOrder.getId());
      assertThat(message.getPaymentState()).isEqualTo(newState);
    }
);
    return updatedOrder;
  }
);
}

Fixed version (ground truth):
@Test public void changePaymentState() throws Exception {
  withNonUpdatedOrder(client(),order -> {
    final PaymentState newState=PaymentState.PAID;
    assertThat(order.getPaymentState()).isNotEqualTo(newState);
    final Order updatedOrder=client().executeBlocking(OrderUpdateCommand.of(order,ChangePaymentState.of(newState)));
    assertThat(updatedOrder.getPaymentState()).isEqualTo(newState);
    final Query<OrderPaymentStateChangedMessage> query=MessageQuery.of().withPredicates(m -> m.resource().id().is(updatedOrder.getId())).withSort(m -> m.createdAt().sort().desc()).withExpansionPaths(m -> m.resource()).withLimit(1L).forMessageType(OrderPaymentStateChangedMessage.MESSAGE_HINT);
    assertEventually(() -> {
      final PagedQueryResult<OrderPaymentStateChangedMessage> pagedQueryResult=client().executeBlocking(query);
      final Optional<OrderPaymentStateChangedMessage> optMessage=pagedQueryResult.head();
      assertThat(optMessage).isPresent();
      OrderPaymentStateChangedMessage message=optMessage.get();
      assertThat(message.getResource().getId()).isEqualTo(updatedOrder.getId());
      assertThat(message.getPaymentState()).isEqualTo(newState);
    }
);
    return updatedOrder;
  }
);
}
Program: 130834
Project: 130834
Buggy source:
ProductVariantExpansionModel<T> variant();

Fixed version (ground truth):
ExpansionPathContainer<T> variant();
Program: 130835
Project: 130835
Buggy source:
@Override public ProductVariantExpansionModel<T> variant(){
  return ProductVariantExpansionModel.of(buildPathExpression(),"String_Node_Str");
}

Fixed version (ground truth):
@Override public ExpansionPathContainer<T> variant(){
  return expansionPath("String_Node_Str");
}
Program: 130836
Project: 130836
Buggy source:
@Override public ExpansionPathContainer<T> productSlug(){
  return new ExpansionModelImpl<T>(buildPathExpression(),"String_Node_Str");
}

Fixed version (ground truth):
@Override public ExpansionPathContainer<T> productSlug(){
  return expansionPath("String_Node_Str");
}
Program: 130837
Project: 130837
Buggy source:
private ProductVariantDraftBuilder(){
}

Fixed version (ground truth):
ProductVariantDraftBuilder(@Nullable final List<AssetDraft> assets,final List<AttributeDraft> attributes,final List<Image> images,@Nullable final String key,final List<PriceDraft> prices,@Nullable final String sku){
  super(assets,attributes,images,key,prices,sku);
}
Program: 130838
Project: 130838
Buggy source:
public ProductVariantDraftBuilder plusAttribute(final AttributeDraft attribute){
  return attributes(listOf(attributes,attribute));
}

Fixed version (ground truth):
public ProductVariantDraftBuilder plusAttribute(final AttributeDraft attribute){
  return attributes != null ? attributes(listOf(attributes,attribute)) : attributes(attribute);
}
Program: 130839
Project: 130839
Buggy source:
@Test public void queryBySku(){
  final String sku="String_Node_Str";
  final ProductVariantDraft masterVariant=ProductVariantDraftBuilder.of().sku(sku).plusAttribute(Sizes.ATTRIBUTE.draftOf(Sizes.S)).plusAttribute(Colors.ATTRIBUTE.draftOf(Colors.GREEN)).build();
  final ProductDraft productDraft=ProductDraftBuilder.of(productType,en("String_Node_Str"),en("String_Node_Str"),masterVariant).build();
  client().executeBlocking(ProductCreateCommand.of(productDraft));
  final PagedQueryResult<Product> result=client().executeBlocking(ProductQuery.of().bySku(sku,STAGED));
  assertThat(result.getResults()).hasSize(1);
  assertThat(result.getResults().get(0).getMasterData().getStaged().getMasterVariant().getSku()).contains(sku);
  assertThat(result.getResults().get(0).getMasterData().getStaged().getMasterVariant().findAttribute(Colors.ATTRIBUTE)).contains(Colors.GREEN);
  assertThat(result.getResults().get(0).getMasterData().getStaged().getMasterVariant().findAttribute(Sizes.ATTRIBUTE)).contains(Sizes.S);
}

Fixed version (ground truth):
@Test public void queryBySku(){
  final String sku="String_Node_Str";
  final ProductVariantDraft masterVariant=ProductVariantDraftBuilder.of().sku(sku).attributes(Sizes.ATTRIBUTE.draftOf(Sizes.S),Colors.ATTRIBUTE.draftOf(Colors.GREEN)).build();
  final ProductDraft productDraft=ProductDraftBuilder.of(productType,en("String_Node_Str"),en("String_Node_Str"),masterVariant).build();
  client().executeBlocking(ProductCreateCommand.of(productDraft));
  final PagedQueryResult<Product> result=client().executeBlocking(ProductQuery.of().bySku(sku,STAGED));
  assertThat(result.getResults()).hasSize(1);
  assertThat(result.getResults().get(0).getMasterData().getStaged().getMasterVariant().getSku()).contains(sku);
  assertThat(result.getResults().get(0).getMasterData().getStaged().getMasterVariant().findAttribute(Colors.ATTRIBUTE)).contains(Colors.GREEN);
  assertThat(result.getResults().get(0).getMasterData().getStaged().getMasterVariant().findAttribute(Sizes.ATTRIBUTE)).contains(Sizes.S);
}
Program: 130840
Project: 130840
Buggy source:
private ProductVariantDraft createBananaVariant(){
  return ProductVariantDraftBuilder.of().plusAttribute(Banana.bananaColor.draftOf("String_Node_Str")).plusAttribute(Banana.nutrients.draftOf(asSet(AttributeContainerDraft.of(asList(Nutrient.servingSize.draftOf(1.5D),Nutrient.servingSizeUOM.draftOf("String_Node_Str"),Nutrient.nutrientInformation.draftOf(asSet(AttributeContainerDraft.of(NutrientInfo.nutrientTypeCode.draftOf("String_Node_Str"),NutrientInfo.measurementPrecision.draftOf("String_Node_Str"),NutrientInfo.quantityContained.draftOf(3.8D),NutrientInfo.quantityContainedUOM.draftOf("String_Node_Str")),AttributeContainerDraft.of(NutrientInfo.nutrientTypeCode.draftOf("String_Node_Str"),NutrientInfo.measurementPrecision.draftOf("String_Node_Str"),NutrientInfo.quantityContained.draftOf(0.06D),NutrientInfo.quantityContainedUOM.draftOf("String_Node_Str")))))),AttributeContainerDraft.of(asList(Nutrient.servingSize.draftOf(0.05D),Nutrient.servingSizeUOM.draftOf("String_Node_Str"),Nutrient.nutrientInformation.draftOf(asSet(AttributeContainerDraft.of(asList(NutrientInfo.nutrientTypeCode.draftOf("String_Node_Str"),NutrientInfo.measurementPrecision.draftOf("String_Node_Str"),NutrientInfo.quantityContained.draftOf(1.3D),NutrientInfo.quantityContainedUOM.draftOf("String_Node_Str")))))))))).sku(randomKey()).build();
}

Fixed version (ground truth):
private ProductVariantDraft createBananaVariant(){
  return ProductVariantDraftBuilder.of().attributes(Banana.bananaColor.draftOf("String_Node_Str"),Banana.nutrients.draftOf(asSet(AttributeContainerDraft.of(asList(Nutrient.servingSize.draftOf(1.5D),Nutrient.servingSizeUOM.draftOf("String_Node_Str"),Nutrient.nutrientInformation.draftOf(asSet(AttributeContainerDraft.of(NutrientInfo.nutrientTypeCode.draftOf("String_Node_Str"),NutrientInfo.measurementPrecision.draftOf("String_Node_Str"),NutrientInfo.quantityContained.draftOf(3.8D),NutrientInfo.quantityContainedUOM.draftOf("String_Node_Str")),AttributeContainerDraft.of(NutrientInfo.nutrientTypeCode.draftOf("String_Node_Str"),NutrientInfo.measurementPrecision.draftOf("String_Node_Str"),NutrientInfo.quantityContained.draftOf(0.06D),NutrientInfo.quantityContainedUOM.draftOf("String_Node_Str")))))),AttributeContainerDraft.of(asList(Nutrient.servingSize.draftOf(0.05D),Nutrient.servingSizeUOM.draftOf("String_Node_Str"),Nutrient.nutrientInformation.draftOf(asSet(AttributeContainerDraft.of(asList(NutrientInfo.nutrientTypeCode.draftOf("String_Node_Str"),NutrientInfo.measurementPrecision.draftOf("String_Node_Str"),NutrientInfo.quantityContained.draftOf(1.3D),NutrientInfo.quantityContainedUOM.draftOf("String_Node_Str")))))))))).sku(randomKey()).build();
}
Program: 130841
Project: 130841
Buggy source:
@Override public ProductDraft get(){
  final ProductVariantDraft masterVariant=ProductVariantDraftBuilder.of().plusAttribute(Sizes.ATTRIBUTE.draftOf(Sizes.S)).plusAttribute(Colors.ATTRIBUTE.draftOf(Colors.GREEN)).sku(UUID.randomUUID().toString()).build();
  final LocalizedString slug=en(name).slugifiedUnique();
  return ProductDraftBuilder.of(productType,en(name),slug,masterVariant).description(en(name)).metaTitle(en("String_Node_Str")).metaDescription(en("String_Node_Str")).metaKeywords(en("String_Node_Str")).build();
}

Fixed version (ground truth):
@Override public ProductDraft get(){
  final ProductVariantDraft masterVariant=ProductVariantDraftBuilder.of().attributes(Sizes.ATTRIBUTE.draftOf(Sizes.S),Colors.ATTRIBUTE.draftOf(Colors.GREEN)).sku(UUID.randomUUID().toString()).build();
  final LocalizedString slug=en(name).slugifiedUnique();
  return ProductDraftBuilder.of(productType,en(name),slug,masterVariant).description(en(name)).metaTitle(en("String_Node_Str")).metaDescription(en("String_Node_Str")).metaKeywords(en("String_Node_Str")).build();
}
Program: 130842
Project: 130842
Buggy source:
@Override public ProductDraft get(){
  final ProductVariantDraft masterVariant=ProductVariantDraftBuilder.of().plusAttribute(Sizes.ATTRIBUTE.draftOf(Sizes.S)).plusAttribute(Colors.ATTRIBUTE.draftOf(Colors.GREEN)).sku(UUID.randomUUID().toString()).prices(PriceDraft.of(MoneyImpl.ofCents(1234,EUR))).build();
  final ProductVariantDraft secondVariant=ProductVariantDraftBuilder.of().plusAttribute(Sizes.ATTRIBUTE.draftOf(Sizes.M)).plusAttribute(Colors.ATTRIBUTE.draftOf(Colors.GREEN)).sku(UUID.randomUUID().toString()).prices(PriceDraft.of(MoneyImpl.ofCents(1234,EUR)),PriceDraft.of(MoneyImpl.ofCents(600,EUR)).withCustomerGroup(customerGroup)).build();
  final LocalizedString slug=en(name).slugifiedUnique();
  return ProductDraftBuilder.of(productType,en(name),slug,masterVariant).variants(asList(secondVariant)).description(en(name)).metaTitle(en("String_Node_Str")).metaDescription(en("String_Node_Str")).metaKeywords(en("String_Node_Str")).build();
}

Fixed version (ground truth):
@Override public ProductDraft get(){
  final ProductVariantDraft masterVariant=ProductVariantDraftBuilder.of().attributes(Sizes.ATTRIBUTE.draftOf(Sizes.S),Colors.ATTRIBUTE.draftOf(Colors.GREEN)).sku(UUID.randomUUID().toString()).prices(PriceDraft.of(MoneyImpl.ofCents(1234,EUR))).build();
  final ProductVariantDraft secondVariant=ProductVariantDraftBuilder.of().attributes(Sizes.ATTRIBUTE.draftOf(Sizes.M),Colors.ATTRIBUTE.draftOf(Colors.GREEN)).sku(UUID.randomUUID().toString()).prices(PriceDraft.of(MoneyImpl.ofCents(1234,EUR)),PriceDraft.of(MoneyImpl.ofCents(600,EUR)).withCustomerGroup(customerGroup)).build();
  final LocalizedString slug=en(name).slugifiedUnique();
  return ProductDraftBuilder.of(productType,en(name),slug,masterVariant).variants(asList(secondVariant)).description(en(name)).metaTitle(en("String_Node_Str")).metaDescription(en("String_Node_Str")).metaKeywords(en("String_Node_Str")).build();
}
Program: 130843
Project: 130843
Buggy source:
private static CartDiscountDraftBuilder newCartDiscountDraftBuilder(final String predicate){
  final ZonedDateTime validFrom=ZonedDateTime.now();
  final ZonedDateTime validUntil=validFrom.plusSeconds(8000);
  final LocalizedString name=en("String_Node_Str");
  final LocalizedString description=en("String_Node_Str");
  final AbsoluteCartDiscountValue value=CartDiscountValue.ofAbsolute(MoneyImpl.of(10,EUR));
  final LineItemsTarget target=LineItemsTarget.of("String_Node_Str");
  final String sortOrder=randomSortOrder();
  final boolean requiresDiscountCode=false;
  return CartDiscountDraftBuilder.of(name,CartDiscountPredicate.of(predicate),value,target,sortOrder,requiresDiscountCode).validFrom(validFrom).validUntil(validUntil).description(description);
}

Fixed version (ground truth):
private static CartDiscountDraftBuilder newCartDiscountDraftBuilder(final String predicate){
  final ZonedDateTime validFrom=ZonedDateTime.now().minusHours(1);
  final ZonedDateTime validUntil=validFrom.plusSeconds(8000);
  final LocalizedString name=en("String_Node_Str");
  final LocalizedString description=en("String_Node_Str");
  final AbsoluteCartDiscountValue value=CartDiscountValue.ofAbsolute(MoneyImpl.of(10,EUR));
  final LineItemsTarget target=LineItemsTarget.of("String_Node_Str");
  final String sortOrder=randomSortOrder();
  final boolean requiresDiscountCode=false;
  return CartDiscountDraftBuilder.of(name,CartDiscountPredicate.of(predicate),value,target,sortOrder,requiresDiscountCode).validFrom(validFrom).validUntil(validUntil).description(description);
}