DataServiceVisitorJsBuilder extends AbstractDataServiceVisitor { void writeReturnComment(TypeMirror returnType, Writer writer) throws IOException { String type = returnType.toString(); if (!"void".equals(type)) { writer.append(TAB2).append(" * @return ").append(OPENBRACE).append(type).append(CLOSEBRACE).append(CR); } } DataServiceVisitorJsBuilder(ProcessingEnvironment environment, FwkWriter fwk);   }
@Test public void writeReturnCommentTest() throws IOException { System.out.println("writeReturnComment"); Writer writer = new StringWriter(); TypeMirror returnType = mock(TypeMirror.class); when(returnType.toString()).thenReturn("void").thenReturn("java.lang.String"); instance.writeReturnComment(returnType, writer); assertThat(writer.toString()).isEqualTo(""); instance.writeReturnComment(returnType, writer); assertThat(writer.toString()).isEqualTo(TAB2+" * @return {java.lang.String}"+CR); }