AndroidStringDocumentMapper { static String removeBadCharacters(String source) { return Strings.nullToEmpty(source) .replaceAll("\u001d", "") .replaceAll("\u001c", "") .replaceAll("\u0000", ""); } AndroidStringDocumentMapper(String pluralSeparator,
                                       String assetDelimiter,
                                       String locale,
                                       String repositoryName);  AndroidStringDocumentMapper(String pluralSeparator, String assetDelimiter); AndroidStringDocument readFromTextUnits(List<TextUnitDTO> textUnits, boolean useSource); AndroidStringDocument readFromSourceTextUnits(List<TextUnitDTO> textUnits); AndroidStringDocument readFromTargetTextUnits(List<TextUnitDTO> textUnits); List<TextUnitDTO> mapToTextUnits(AndroidStringDocument document); Stream<TextUnitDTO> mapToTextUnitStream(AndroidStringDocument document);  }
@Test public void testRemoveBadCharacters() { assertThat(removeBadCharacters(null)).isEqualTo(""); assertThat(removeBadCharacters("")).isEqualTo(""); assertThat(removeBadCharacters("String")).isEqualTo("String"); assertThat(removeBadCharacters("second" + '\u0000' + "String")).isEqualTo("secondString"); assertThat(removeBadCharacters("third" + '\u001c' + "String")).isEqualTo("thirdString"); assertThat(removeBadCharacters("fourth" + '\u001d' + "String")).isEqualTo("fourthString"); assertThat(removeBadCharacters("all" + '\u0000' + "Bad" + '\u001c' + "Characters" + '\u001d' + "Removed")) .isEqualTo("allBadCharactersRemoved"); }