DataServiceVisitorJsBuilder extends AbstractDataServiceVisitor { void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException { while(argumentsType.hasNext()) { String type = argumentsType.next(); String name = argumentsName.next(); writer.append(TAB2).append(" * @param ").append(OPENBRACE).append(type).append(CLOSEBRACE).append(SPACE).append(name).append(CR); } } DataServiceVisitorJsBuilder(ProcessingEnvironment environment, FwkWriter fwk);   }
@Test public void writeArgumentsCommentTest() throws IOException { System.out.println("writeArgumentsComment"); Writer writer; Iterator<String> argumentsType0 = new ArrayList<String>().iterator(); Iterator<String> argumentsName0 = new ArrayList<String>().iterator(); Iterator<String> argumentsType1 = Arrays.asList("java.lang.String").iterator(); Iterator<String> argumentsName1 = Arrays.asList("a").iterator(); Iterator<String> argumentsType2 = Arrays.asList("java.lang.String", "long").iterator(); Iterator<String> argumentsName2 = Arrays.asList("a", "b").iterator(); writer = new StringWriter(); instance.writeArgumentsComment(argumentsType0, argumentsName0, writer); assertThat(writer.toString()).isEmpty(); writer = new StringWriter(); instance.writeArgumentsComment(argumentsType1, argumentsName1, writer); assertThat(writer.toString()).isEqualTo(TAB2+" * @param {java.lang.String}"+SPACE+"a"+CR); writer = new StringWriter(); instance.writeArgumentsComment(argumentsType2, argumentsName2, writer); assertThat(writer.toString()).isEqualTo(TAB2+" * @param {java.lang.String}"+SPACE+"a"+CR+TAB2+" * @param {long}"+SPACE+"b"+CR); }