SampleGenotype { @JsonIgnore public boolean isHet() { if (alleleCalls.length <= 1) { return false; } AlleleCall first = alleleCalls[0]; for (int i = 1; i < alleleCalls.length; i++) { AlleleCall current = alleleCalls[i]; if (first != current) { return true; } } return false; } private  SampleGenotype(boolean phased, AlleleCall... alleleCalls); static SampleGenotype empty(); static SampleGenotype noCall(); static SampleGenotype het(); static SampleGenotype homRef(); static SampleGenotype homAlt(); static SampleGenotype of(AlleleCall... alleleCalls); static SampleGenotype phased(AlleleCall... alleleCalls); List<AlleleCall> getCalls(); @JsonIgnore boolean isHet(); @JsonIgnore boolean isHomRef(); @JsonIgnore boolean isHomAlt(); @JsonIgnore boolean isPhased(); @JsonIgnore boolean isEmpty(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test void testIsHet() { assertThat(SampleGenotype.het().isHet(), is(true)); assertThat(SampleGenotype.of(AlleleCall.REF).isHet(), is(false)); assertThat(SampleGenotype.of(AlleleCall.REF, AlleleCall.NO_CALL).isHet(), is(true)); assertThat(SampleGenotype.of(AlleleCall.REF, AlleleCall.ALT).isHet(), is(true)); assertThat(SampleGenotype.of(AlleleCall.REF, AlleleCall.ALT, AlleleCall.REF).isHet(), is(true)); assertThat(SampleGenotype.of(AlleleCall.REF, AlleleCall.OTHER_ALT).isHet(), is(true)); assertThat(SampleGenotype.of(AlleleCall.ALT, AlleleCall.OTHER_ALT).isHet(), is(true)); assertThat(SampleGenotype.phased(AlleleCall.REF, AlleleCall.OTHER_ALT).isHet(), is(true)); assertThat(SampleGenotype.empty().isHet(), is(false)); assertThat(SampleGenotype.homRef().isHet(), is(false)); assertThat(SampleGenotype.homAlt().isHet(), is(false)); }