@Override public Object create(Random random) { try { String lang = TestSnowball.SNOWBALL_LANGS[random.nextInt(TestSnowball.SNOWBALL_LANGS.length)]; Class<? extends SnowballProgram> clazz = Class.forName("org.tartarus.snowball.ext." + lang + "Stemmer").asSubclass(SnowballProgram.class); return clazz.newInstance(); } catch (Exception ex) { Rethrow.rethrow(ex); return null; // unreachable code } }