SampleGenotype { @JsonIgnore public boolean isHomAlt() { if (alleleCalls.length == 0) { return false; } for (int i = 0, alleleCallsLength = alleleCalls.length; i < alleleCallsLength; i++) { AlleleCall alleleCall = alleleCalls[i]; if (alleleCall == AlleleCall.REF || alleleCall == AlleleCall.NO_CALL || alleleCall == AlleleCall.OTHER_ALT) { return false; } } return true; } 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 testIsHomAlt() { assertThat(SampleGenotype.homAlt().isHomAlt(), is(true)); assertThat(SampleGenotype.of(AlleleCall.ALT).isHomAlt(), is(true)); assertThat(SampleGenotype.of(AlleleCall.ALT, AlleleCall.ALT).isHomAlt(), is(true)); assertThat(SampleGenotype.of(AlleleCall.ALT, AlleleCall.ALT, AlleleCall.ALT).isHomAlt(), is(true)); assertThat(SampleGenotype.phased(AlleleCall.ALT, AlleleCall.ALT).isHomAlt(), is(true)); assertThat(SampleGenotype.of(AlleleCall.ALT, AlleleCall.NO_CALL).isHomAlt(), is(false)); assertThat(SampleGenotype.of(AlleleCall.OTHER_ALT, AlleleCall.NO_CALL).isHomAlt(), is(false)); assertThat(SampleGenotype.empty().isHomAlt(), is(false)); assertThat(SampleGenotype.het().isHomAlt(), is(false)); assertThat(SampleGenotype.homRef().isHomAlt(), is(false)); }