### Question:
DoubleMetaphone implements StringEncoder { public boolean isDoubleMetaphoneEqual(final String value1, final String value2) { return isDoubleMetaphoneEqual(value1, value2, false); } DoubleMetaphone(); String doubleMetaphone(final String value); String doubleMetaphone(String value, final boolean alternate); @Override Object encode(final Object obj); @Override String encode(final String value); boolean isDoubleMetaphoneEqual(final String value1, final String value2); boolean isDoubleMetaphoneEqual(final String value1, final String value2, final boolean alternate); int getMaxCodeLen(); void setMaxCodeLen(final int maxCodeLen);  }### Answer:
@Test public void testCCedilla() { assertTrue(this.getStringEncoder().isDoubleMetaphoneEqual("\u00e7", "S")); }
@Test public void testCodec184() throws Throwable { assertTrue(new DoubleMetaphone().isDoubleMetaphoneEqual("", "", false)); assertTrue(new DoubleMetaphone().isDoubleMetaphoneEqual("", "", true)); assertFalse(new DoubleMetaphone().isDoubleMetaphoneEqual("aa", "", false)); assertFalse(new DoubleMetaphone().isDoubleMetaphoneEqual("aa", "", true)); assertFalse(new DoubleMetaphone().isDoubleMetaphoneEqual("", "aa", false)); assertFalse(new DoubleMetaphone().isDoubleMetaphoneEqual("", "aa", true)); }
@Test public void testIsDoubleMetaphoneEqualExtended3() { this.validateFixture(FIXTURE); final StringBuilder failures = new StringBuilder(); final StringBuilder matches = new StringBuilder(); final String cr = System.getProperty("line.separator"); matches.append("private static final String[][] MATCHES = {" + cr); int failCount = 0; for (int i = 0; i < FIXTURE.length; i++) { final String name0 = FIXTURE[i][0]; final String name1 = FIXTURE[i][1]; final boolean match1 = this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, false); final boolean match2 = this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, true); if (match1 == false && match2 == false) { final String failMsg = "[" + i + "] " + name0 + " and " + name1 + cr; failures.append(failMsg); failCount++; } else { matches.append("{\"" + name0 + "\", \"" + name1 + "\"}," + cr); } } matches.append("};"); if (failCount > 0) { } }
@Test public void testIsDoubleMetaphoneEqualWithMATCHES() { this.validateFixture(MATCHES); for (int i = 0; i < MATCHES.length; i++) { final String name0 = MATCHES[i][0]; final String name1 = MATCHES[i][1]; final boolean match1 = this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, false); final boolean match2 = this.getStringEncoder().isDoubleMetaphoneEqual(name0, name1, true); if (match1 == false && match2 == false) { fail("Expected match [" + i + "] " + name0 + " and " + name1); } } }
@Test public void testNTilde() { assertTrue(this.getStringEncoder().isDoubleMetaphoneEqual("\u00f1", "N")); }