CodeGeneratorMojo extends AbstractMojo { protected String toValidJavaClassName(String name) { return WordUtils.capitalize(name, new char[] { ' ', '_', '-' }).replaceAll(" ", "").replaceAll("-", "") .replaceAll("_", ""); }  @Override void execute(); static void main(String[] args);  }
@Test public void testToValidJavaClassName() { CodeGeneratorMojo mojo = new CodeGeneratorMojo(); assertThat(mojo.toValidJavaClassName("vaadinator-test"), is("VaadinatorTest")); assertThat(mojo.toValidJavaClassName("Vaadinator-Test"), is("VaadinatorTest")); assertThat(mojo.toValidJavaClassName("vaadinator-test_1"), is("VaadinatorTest1")); assertThat(mojo.toValidJavaClassName("vaadinatorExample-test_1"), is("VaadinatorExampleTest1")); assertThat(mojo.toValidJavaClassName("VaadinatorExample-test_1"), is("VaadinatorExampleTest1")); assertThat(mojo.toValidJavaClassName("Vaadinatorexample-test_1"), is("VaadinatorexampleTest1")); }