SnpEffAnnotation implements TranscriptAnnotation { @NotNull public String consequenceString() { final StringJoiner consequenceString = new StringJoiner("; "); for (final VariantConsequence consequence : consequences()) { if (!consequence.readableSequenceOntologyTerm().isEmpty()) { consequenceString.add(consequence.readableSequenceOntologyTerm()); } } return consequenceString.toString(); }  @NotNull abstract String allele(); @NotNull abstract String effects(); @NotNull abstract List<VariantConsequence> consequences(); @NotNull String consequenceString(); @NotNull abstract String severity(); @Override @NotNull abstract String gene(); @NotNull abstract String geneID(); @NotNull abstract String featureType(); @NotNull abstract String featureID(); @NotNull abstract String hgvsCoding(); @NotNull abstract String hgvsProtein(); @NotNull abstract String aaPosAndLength(); @Override @NotNull String transcript(); boolean isTranscriptFeature();  }
@Test public void canGenerateConsequenceString() { final SnpEffAnnotation noConsequences = annotation(); assertEquals(Strings.EMPTY, noConsequences.consequenceString()); final SnpEffAnnotation oneConsequence = annotation(VariantConsequence.MISSENSE_VARIANT); assertEquals(VariantConsequence.MISSENSE_VARIANT.readableSequenceOntologyTerm(), oneConsequence.consequenceString()); final SnpEffAnnotation twoConsequences = annotation(VariantConsequence.MISSENSE_VARIANT, VariantConsequence.INFRAME_DELETION); assertTrue(twoConsequences.consequenceString().contains(VariantConsequence.MISSENSE_VARIANT.readableSequenceOntologyTerm())); assertTrue(twoConsequences.consequenceString().contains(VariantConsequence.INFRAME_DELETION.readableSequenceOntologyTerm())); final SnpEffAnnotation twoConsequencesIgnoreOne = annotation(VariantConsequence.MISSENSE_VARIANT, VariantConsequence.OTHER); assertEquals(VariantConsequence.MISSENSE_VARIANT.readableSequenceOntologyTerm(), twoConsequencesIgnoreOne.consequenceString()); }