DAFileWriter implements DAWriter { public DAFileWriter appendPackage(@Nonnull DAName packageName) throws IOException { this.packageName = checkNotNull(packageName, "PackageName can not be null"); if (packageName.length() > 0) { writer.append("package ").append(packageName).append(";"); writer.newLine(); writer.newLine(); } return this; } DAFileWriter(BufferedWriter writer); DAFileWriter appendPackage(@Nonnull DAName packageName); DAFileWriter appendImports(@Nonnull Collection<DAImport> mapperImports); DAFileWriter appendGeneratedAnnotation(@Nonnull Class<? extends Processor> processClass); DAFileWriter appendGeneratedAnnotation(@Nonnull String annotationProcessorQualifiedName); DAClassWriter<DAFileWriter> newClass(DAType classType); DAInterfaceWriter<DAFileWriter> newInterface(String name); void end();  }
@Test public void package_only() throws Exception { FileContextTestImpl fileContext = new FileContextTestImpl(); new DAFileWriter(fileContext.getWriter()).appendPackage(PACKAGE_NAME); assertThat(fileContext.getRes()).isEqualTo( "package com.acme.toto;" + LINE_SEPARATOR + LINE_SEPARATOR ); }