@Test
public void translate_prependsString() throws Exception {

    final Index<?> index = mock(Index.class);
    NameTranslator<Index<?>> translator = new NameTranslator<Index<?>>() {
        @Override
        public String translate(Index<?> value) {
            return (value == index) ? "INDEX" : null;
        }
    };
    PrependingNameTranslator<Index<?>> prepender = new PrependingNameTranslator<>(translator, "PRE_");
    assertEquals("PRE_INDEX", prepender.translate(index));
}