Program: 40722
Project: 40722
Buggy source:
@Test public void testFilterVariantCallsFn(){
  Map<String,ListValue> passingFilter=new HashMap<String,ListValue>();
  passingFilter.put(TransformNonVariantSegmentData.FILTER_FIELD,ListValue.newBuilder().addValues(Value.newBuilder().setStringValue(TransformNonVariantSegmentData.PASSING_FILTER).build()).build());
  VariantCall call1=VariantCall.newBuilder().putAllInfo(passingFilter).build();
  Map<String,ListValue> failingFilter=new HashMap<String,ListValue>();
  failingFilter.put(TransformNonVariantSegmentData.FILTER_FIELD,ListValue.newBuilder().addValues(Value.newBuilder().setStringValue("String_Node_Str").build()).build());
  VariantCall call2=VariantCall.newBuilder().putAllInfo(failingFilter).build();
  Map<String,ListValue> ambiguousFilter=new HashMap<String,ListValue>();
  ambiguousFilter.put(TransformNonVariantSegmentData.FILTER_FIELD,ListValue.newBuilder().addValues(Value.newBuilder().setStringValue("String_Node_Str").build()).addValues(Value.newBuilder().setStringValue(TransformNonVariantSegmentData.PASSING_FILTER).build()).build());
  VariantCall call3=VariantCall.newBuilder().putAllInfo(ambiguousFilter).build();
  Variant inputVariant=Variant.newBuilder().addAllCalls(Arrays.asList(call1,call2,call3)).build();
  Variant expectedVariant=Variant.newBuilder().addAllCalls(Arrays.asList(call1,call3)).build();
  DoFnTester<Variant,Variant> filterCallsFn=DoFnTester.of(new FilterCallsFn());
  Assert.assertThat(filterCallsFn.processBatch(inputVariant),CoreMatchers.allOf(CoreMatchers.hasItems(expectedVariant)));
}

Fixed version (ground truth):
@Test public void testFilterVariantCallsFn(){
  DoFnTester<Variant,Variant> filterCallsFn=DoFnTester.of(new FilterCallsFn());
  Map<String,ListValue> passingFilter=new HashMap<String,ListValue>();
  passingFilter.put(TransformNonVariantSegmentData.FILTER_FIELD,ListValue.newBuilder().addValues(Value.newBuilder().setStringValue(TransformNonVariantSegmentData.PASSING_FILTER).build()).build());
  VariantCall call1=VariantCall.newBuilder().putAllInfo(passingFilter).build();
  Map<String,ListValue> failingFilter=new HashMap<String,ListValue>();
  failingFilter.put(TransformNonVariantSegmentData.FILTER_FIELD,ListValue.newBuilder().addValues(Value.newBuilder().setStringValue("String_Node_Str").build()).build());
  VariantCall call2=VariantCall.newBuilder().putAllInfo(failingFilter).build();
  Map<String,ListValue> ambiguousFilter=new HashMap<String,ListValue>();
  ambiguousFilter.put(TransformNonVariantSegmentData.FILTER_FIELD,ListValue.newBuilder().addValues(Value.newBuilder().setStringValue("String_Node_Str").build()).addValues(Value.newBuilder().setStringValue(TransformNonVariantSegmentData.PASSING_FILTER).build()).build());
  VariantCall call3=VariantCall.newBuilder().putAllInfo(ambiguousFilter).build();
  Variant inputVariant=Variant.newBuilder().setReferenceBases("String_Node_Str").addAlternateBases("String_Node_Str").addAllCalls(Arrays.asList(call1,call2,call3)).build();
  Variant expectedVariant=Variant.newBuilder().setReferenceBases("String_Node_Str").addAlternateBases("String_Node_Str").addAllCalls(Arrays.asList(call1,call3)).build();
  Iterator<Variant> filtered1=filterCallsFn.processBatch(inputVariant).iterator();
  assertEquals(filtered1.next(),expectedVariant);
  assertFalse(filtered1.hasNext());
  Variant inputBlockRecord=Variant.newBuilder().setReferenceBases("String_Node_Str").addAllCalls(Arrays.asList(call1,call2,call3)).build();
  Variant expectedBlockRecord=Variant.newBuilder().setReferenceBases("String_Node_Str").addAllCalls(Arrays.asList(call1,call2,call3)).build();
  Iterator<Variant> filtered2=filterCallsFn.processBatch(inputBlockRecord).iterator();
  assertEquals(filtered2.next(),expectedBlockRecord);
  assertFalse(filtered2.hasNext());
}