VariantEvaluation implements Comparable<VariantEvaluation>, Filterable, Inheritable, Variant { @Override public int compareTo(VariantEvaluation other) { if (this.chr != other.chr) { return Integer.compare(this.chr, other.chr); } if (this.pos != other.pos) { return Integer.compare(this.pos, other.pos); } if (!this.ref.equals(other.ref)) { return this.ref.compareTo(other.ref); } return this.alt.compareTo(other.alt); } private  VariantEvaluation(Builder builder); @Override GenomeAssembly getGenomeAssembly(); @Override int getChromosome(); @Override String getChromosomeName(); @Override int getPosition(); @Override String getRef(); @Override String getAlt(); VariantContext getVariantContext(); int getAltAlleleId(); String getId(); double getPhredScore(); @Override VariantEffect getVariantEffect(); void setVariantEffect(VariantEffect ve); @Override String getGeneSymbol(); void setGeneSymbol(String symbol); @Override String getGeneId(); void setGeneId(String geneId); @Override List<TranscriptAnnotation> getTranscriptAnnotations(); void setAnnotations(List<TranscriptAnnotation> annotations); @Override boolean hasTranscriptAnnotations(); @JsonIgnore String getHgvsGenome(); @JsonIgnore String getGenotypeString(); Map<String, SampleGenotype> getSampleGenotypes(); SampleGenotype getSampleGenotype(String sampleId); @Override boolean addFilterResult(FilterResult filterResult); Set<FilterType> getPassedFilterTypes(); Set<FilterType> getFailedFilterTypes(); synchronized Set<FilterType> getFailedFilterTypesForMode(ModeOfInheritance modeOfInheritance); @Override synchronized boolean passedFilters(); @Override synchronized boolean passedFilter(FilterType filterType); FilterStatus getFilterStatus(); FilterStatus getFilterStatusForMode(ModeOfInheritance modeOfInheritance); float getVariantScore(); float getFrequencyScore(); float getPathogenicityScore(); boolean isPredictedPathogenic(); FrequencyData getFrequencyData(); void setFrequencyData(FrequencyData frequencyData); PathogenicityData getPathogenicityData(); void setPathogenicityData(PathogenicityData pathogenicityData); boolean isWhiteListed(); void setWhiteListed(boolean whiteListed); void setContributesToGeneScoreUnderMode(ModeOfInheritance modeOfInheritance); boolean contributesToGeneScore(); boolean contributesToGeneScoreUnderMode(ModeOfInheritance modeOfInheritance); @Override void setCompatibleInheritanceModes(Set<ModeOfInheritance> compatibleModes); @Override Set<ModeOfInheritance> getCompatibleInheritanceModes(); @Override boolean isCompatibleWith(ModeOfInheritance modeOfInheritance); @Override int compareTo(VariantEvaluation other); static int compareByRank(VariantEvaluation some, VariantEvaluation other); @Override int hashCode(); @Override boolean equals(Object obj); String toString(); static Builder builder(int chr, int pos, String ref, String alt);  }
@Test public void testCompareTo() { VariantEvaluation zero = VariantEvaluation.builder(1, 1, "A", "C").build(); VariantEvaluation one = VariantEvaluation.builder(1, 2, "A", "G").build(); VariantEvaluation two = VariantEvaluation.builder(1, 2, "AC", "G").build(); VariantEvaluation three = VariantEvaluation.builder(2, 1, "C", "T").build(); VariantEvaluation four = VariantEvaluation.builder(2, 1, "C", "TT").build(); List<VariantEvaluation> variants = Arrays.asList(zero, one, two, three, four); Collections.shuffle(variants); System.out.println("Shuffled:"); variants.forEach(variant -> System.out.printf("chr: %2d pos: %2d ref: %-2s alt: %-2s%n", variant.getChromosome(), variant.getPosition(), variant.getRef(), variant.getAlt())); Collections.sort(variants); List<VariantEvaluation> expected = Arrays.asList(zero, one, two, three, four); System.out.println("Sorted:"); variants.forEach(variant -> System.out.printf("chr: %2d pos: %2d ref: %-2s alt: %-2s%n", variant.getChromosome(), variant.getPosition(), variant.getRef(), variant.getAlt())); assertThat(variants, equalTo(expected)); }