### Question:
Recording implements Parcelable { public static boolean hasIllegalChar(CharSequence fileName) { Pattern pattern = Pattern.compile("[^a-zA-Z0-9.\\- ]"); Matcher matcher = pattern.matcher(fileName); return matcher.find(); } Recording();  Recording(Long id, Long contactId, String path, Boolean incoming, Long startTimestamp, Long endTimestamp,
                     String format, Boolean isNameSet, String mode, String source); protected  Recording(Parcel in); boolean exists(); boolean isSavedInPrivateSpace(Context context); long getLength(); void update(Repository repository); void save(Repository repository); String getName(); static boolean hasIllegalChar(CharSequence fileName); long getSize(); String getDate(); String getTime(); void delete(Repository repository); void move(Repository repository, String folderPath, @Nullable MoveAsyncTask asyncTask, long totalSize); String getHumanReadingFormat(Context context); Long getId(); void setId(long id); void setContactId(long contactId); String getPath(); void setPath(String path); Boolean isIncoming(); void setIncoming(boolean incoming); void setFormat(String format); String getFormat(); Boolean getIsNameSet(); void setIsNameSet(Boolean isNameSet); Long getContactId(); void setContactId(Long contactId); String getSource(); void setSource(String source); Long getStartTimestamp(); Long getEndTimestamp(); String getMode(); void setStartTimestamp(Long startTimestamp); void setEndTimestamp(Long endTimestamp); void setMode(String mode); @Override boolean equals(Object o); @Override int hashCode(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static final Creator<Recording> CREATOR; }### Answer:
@Test public void hasIllegalCharacter_IllegalChar_returnsTrue() { String illegals = "~!@#$%^&*()+=?|\\':;\"><{}[]/"; for(int i = 0; i < illegals.length(); ++i) { char c = illegals.charAt(i); assertTrue(Recording.hasIllegalChar(Character.toString(c))); } }
@Test public void hasIllegalCharacter_legalChars_returnsFalse() { String legalChars = "abcde10ABC.-"; assertFalse(Recording.hasIllegalChar(legalChars)); }