@Test
    public void testTranslateGuessLanguage() {
        String source = "bonjour comment vas-tu";
        String expected = "hello how are you";

        String result = null;
        if (translator.isAvailable()) {
            try {
                result = translator.translate(source, "en");
                assertNotNull(result);
                assertEquals(expected, result,
                        "Result: [" + result + "]: not equal to expected: [" + expected + "]");
            } catch (Exception e) {
                e.printStackTrace();
                fail(e.getMessage());
            }
        }

    }
Test harness for the {@link GoogleTranslator}.
tika-translate/src/test/java/org/apache/tika/language/translate/impl/GoogleTranslatorTest.java