AbstractDataServiceVisitor implements ElementVisitor<String, Writer> ,ProcessorConstants { String getJsInstancename(String classname) { char chars[] = classname.toCharArray(); chars[0] = Character.toLowerCase(chars[0]); return new String(chars); } AbstractDataServiceVisitor(ProcessingEnvironment environment); @Override String visitType(TypeElement typeElement, Writer writer); @Override String visit(Element e, Writer p); @Override String visit(Element e); @Override String visitPackage(PackageElement e, Writer p); @Override String visitVariable(VariableElement e, Writer p); @Override String visitExecutable(ExecutableElement e, Writer p); @Override String visitTypeParameter(TypeParameterElement e, Writer p); @Override String visitUnknown(Element e, Writer p);  }
@Test public void testGetJsInstancename() { String result = instance.getJsInstancename("DefaultClassName"); assertThat(result).isEqualTo("defaultClassName"); result = instance.getJsInstancename("SpecifiedClassName"); assertThat(result).isEqualTo("specifiedClassName"); }