EntanglingClass { JavaFile brewJava() { TypeSpec classTypeSpec = createTypeSpec(); return JavaFile.builder(classPackage, classTypeSpec) .addFileComment(GENERATED_CODE_COMMENT) .build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId);   }
@Test public void javaFileShouldHaveCorrectPackageName() { JavaFile javaFile = entanglingClass.brewJava(); assertThat(javaFile.packageName, is(PACKAGE_NAME)); }
@Test public void javaFileShouldHaveGeneratedComment() { JavaFile file = entanglingClass.brewJava(); assertThat(file.fileComment.toString(), is(EntanglingClass.GENERATED_CODE_COMMENT)); }