Buggy code:
@ RunWith ( JUnit4 . class ) public class JoinGvcfVariantsTest { private static final Call [ ] variantCalls = new Call [ ] { DataUtils . makeCall ( "het-alt<seq2seq4repair_space>sample" , 1 , 0 ) , DataUtils . makeCall ( "hom-alt<seq2seq4repair_space>sample" , 1 , 1 ) } ; private static final Call [ ] blockRecord1Calls = new Call [ ] { DataUtils . makeCall ( "hom<seq2seq4repair_space>sample" , 0 , 0 ) , DataUtils . makeCall ( "no<seq2seq4repair_space>call<seq2seq4repair_space>sample" , ( - 1 ) , ( - 1 ) ) } ; private static final Call [ ] blockRecord2Calls = new Call [ ] { DataUtils . makeCall ( "hom<seq2seq4repair_space>no-call<seq2seq4repair_space>sample" , ( - 1 ) , 0 ) } ; private static final Variant expectedSnp1 = DataUtils . makeVariant ( "chr7" , 200010 , 200011 , "A" , Arrays . asList ( "C" ) , JoinGvcfVariantsTest . variantCalls [ 0 ] , JoinGvcfVariantsTest . variantCalls [ 1 ] , JoinGvcfVariantsTest . blockRecord1Calls [ 0 ] , JoinGvcfVariantsTest . blockRecord1Calls [ 1 ] ) ; private static final Variant expectedSnp2 = DataUtils . makeVariant ( "chr7" , 200019 , 200020 , "T" , Arrays . asList ( "G" ) , JoinGvcfVariantsTest . variantCalls [ 0 ] , JoinGvcfVariantsTest . variantCalls [ 1 ] , JoinGvcfVariantsTest . blockRecord1Calls [ 0 ] , JoinGvcfVariantsTest . blockRecord1Calls [ 1 ] , JoinGvcfVariantsTest . blockRecord2Calls [ 0 ] ) ; private static final Variant expectedInsert = DataUtils . makeVariant ( "chr7" , 200010 , 200011 , "A" , Arrays . asList ( "AC" ) , JoinGvcfVariantsTest . variantCalls ) ; private Variant snp1 ; private Variant snp2 ; private Variant insert ; private Variant blockRecord1 ; private Variant blockRecord2 ; private Variant [ ] input ; @ Before public void setUp ( ) { } @ Test public void testVariantVariantComparator ( ) { assertEquals ( ( - 1 ) , GVCF_VARIANT_COMPARATOR . compare ( blockRecord1 , snp1 ) ) ; assertEquals ( 1 , GVCF_VARIANT_COMPARATOR . compare ( blockRecord2 , snp1 ) ) ; assertEquals ( ( - 1 ) , GVCF_VARIANT_COMPARATOR . compare ( snp1 , snp2 ) ) ; <START_BUG> assertEquals ( 0 , GVCF_VARIANT_COMPARATOR . compare ( DataUtils . makeVariant ( "chr7" , 200010 , 200011 , "A" , Arrays . asList ( "C" ) , ( ( Call [ ] ) ( null ) ) ) , DataUtils . makeVariant ( "chr7" , 200010 , 200011 , "A" , Arrays . asList ( "T" ) , ( ( Call [ ] ) ( null ) ) ) ) ) ; <END_BUG> assertEquals ( 1 , GVCF_VARIANT_COMPARATOR . compare ( DataUtils . makeVariant ( "chr7" , 200010 , 200011 , "A" , Arrays . asList ( "C" ) , ( ( Call [ ] ) ( null ) ) ) , DataUtils . makeVariant ( "chr7" , 200010 , 200011 , "A" , null , ( ( Call [ ] ) ( null ) ) ) ) ) ; } @ Test public void testIsOverlapping ( ) { } @ Test public void testBinVariantsFn ( ) { } @ Test public void testJoinGvcfPipeline ( ) { } static class AssertThatHasExpectedContentsForTestJoinGvcf implements SerializableFunction < Iterable < Variant > , Void > { @ Override public Void apply ( Iterable < Variant > actual ) { } } }

Fix:
assertTrue ( ( 0 > ( GVCF_VARIANT_COMPARATOR . compare ( DataUtils . makeVariant ( "chr7" , 200010 , 200011 , "A" , Arrays . asList ( "C" ) , ( ( Call [ ] ) ( null ) ) ) , DataUtils . makeVariant ( "chr7" , 200010 , 200011 , "A" , Arrays . asList ( "T" ) , ( ( Call [ ] ) ( null ) ) ) ) ) ) ) ;