### Question:
BeiderMorseEncoder implements StringEncoder { @Override public Object encode(final Object source) throws EncoderException { if (!(source instanceof String)) { throw new EncoderException("BeiderMorseEncoder encode parameter is not of type String"); } return encode((String) source); }  @Override Object encode(final Object source); @Override String encode(final String source); NameType getNameType(); RuleType getRuleType(); boolean isConcat(); void setConcat(final boolean concat); void setNameType(final NameType nameType); void setRuleType(final RuleType ruleType); void setMaxPhonemes(final int maxPhonemes);  }### Answer:
@Test public void testAllChars() throws EncoderException { final BeiderMorseEncoder bmpm = createGenericApproxEncoder(); for (char c = Character.MIN_VALUE; c < Character.MAX_VALUE; c++) { bmpm.encode(Character.toString(c)); } }
@Test public void testEncodeGna() throws EncoderException { final BeiderMorseEncoder bmpm = createGenericApproxEncoder(); bmpm.encode("gna"); }
@Test(timeout = 10000L) public void testLongestEnglishSurname() throws EncoderException { final BeiderMorseEncoder bmpm = createGenericApproxEncoder(); bmpm.encode("MacGhilleseatheanaich"); }
@Test() public void testSpeedCheck() throws EncoderException { final BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); final StringBuilder stringBuffer = new StringBuilder(); stringBuffer.append(TEST_CHARS[0]); for (int i = 0, j = 1; i < 40; i++, j++) { if (j == TEST_CHARS.length) { j = 0; } bmpm.encode(stringBuffer.toString()); stringBuffer.append(TEST_CHARS[j]); } }
@Test public void testSpeedCheck2() throws EncoderException { final BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); final String phrase = "ItstheendoftheworldasweknowitandIfeelfine"; for (int i = 1; i <= phrase.length(); i++) { bmpm.encode(phrase.subSequence(0, i)); } }
@Test public void testSpeedCheck3() throws EncoderException { final BeiderMorseEncoder bmpm = this.createGenericApproxEncoder(); final String phrase = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; for (int i = 1; i <= phrase.length(); i++) { bmpm.encode(phrase.subSequence(0, i)); } }