@Test
    public void testSimpleTranslate() throws Exception {
        String source = "hola senor";
        String expected = "hello sir";

        if (cachedTranslator.isAvailable()) {
            String result = cachedTranslator.translate(source, "es", "en");
            assertNotNull(result);
            assertEquals("Result: [" + result + "]: not equal to expected: [" + expected + "]",
                    expected, result);
        }
    }
Test harness for the {@link CachedTranslator}. Take care to choose your target language carefully
if you're testing the size of the cache!
tika-translate/src/test/java/org/apache/tika/language/translate/impl/CachedTranslatorTest.java