SnpEffHgvsFormatter { @NotNull @VisibleForTesting static String formattedHgvsProtein(@NotNull SnpEffAnnotation annotation) { String hgvsProtein = annotation.hgvsProtein(); if (hgvsProtein.startsWith(HGVS_PROTEIN_PREFIX_TO_REMOVE)) { hgvsProtein = hgvsProtein.substring(HGVS_PROTEIN_PREFIX_TO_REMOVE.length()); } for (Map.Entry<String, String> mappingEntry : ONE_TO_THREE_AMINO_ACID_MAPPING.entrySet()) { hgvsProtein = hgvsProtein.replaceAll(mappingEntry.getValue(), mappingEntry.getKey()); } return hgvsProtein; } private  SnpEffHgvsFormatter();   }
@Test public void canConvertHgvsProtein() { SnpEffAnnotation snv = SnpEffAnnotationTestFactory.builder().hgvsProtein("p.Val600Lys").build(); assertEquals("V600K", SnpEffHgvsFormatter.formattedHgvsProtein(snv)); SnpEffAnnotation frameshift = SnpEffAnnotationTestFactory.builder().hgvsProtein("p.Ser200fs").build(); assertEquals("S200fs", SnpEffHgvsFormatter.formattedHgvsProtein(frameshift)); }