### Question:
SkeletonBuffer { @Override public String toString() { if (document.getFxomRoot() == null) { return I18N.getString("skeleton.empty"); } else { construct(); StringBuilder code = new StringBuilder(); code.append(header); code.append(packageLine); for (String importStatement : imports) { code.append(importStatement); } code.append(classLine); if (textType == TEXT_TYPE.WITH_COMMENTS && textFormat == FORMAT_TYPE.FULL) { code.append(INDENT).append("@FXML .append(INDENT).append("private ResourceBundle resources;\n\n") .append(INDENT).append("@FXML .append(INDENT).append("private URL location;\n\n"); } else if (textFormat == FORMAT_TYPE.FULL) { code.append(INDENT).append(FXML_ANNOTATION) .append(INDENT).append("private ResourceBundle resources;\n\n") .append(INDENT).append(FXML_ANNOTATION) .append(INDENT).append("private URL location;\n\n"); } code.append(variables); code.append(handlers); code.append(initialize); code.append("}\n"); return code.toString(); } } SkeletonBuffer(FXOMDocument document, String documentName); void setTextType(TEXT_TYPE type); void setFormat(FORMAT_TYPE format); @Override String toString();  }### Answer:
@Test public void testControllerWithoutPackageName() throws IOException { EditorController editorController = new EditorController(); final URL fxmlURL = SkeletonBufferTest.class.getResource("ControllerWithoutPackage.fxml"); final String fxmlText = FXOMDocument.readContentFromURL(fxmlURL); editorController.setFxmlTextAndLocation(fxmlText, fxmlURL, false); SkeletonBuffer skeletonBuffer = new SkeletonBuffer(editorController.getFxomDocument(), "test"); String skeleton = skeletonBuffer.toString(); String firstLine = skeleton.substring(0, skeleton.indexOf("\n")); assertEquals("", firstLine); }
@Test public void testControllerWithSimplePackageName() throws IOException { EditorController editorController = new EditorController(); final URL fxmlURL = SkeletonBufferTest.class.getResource("ControllerWithSimplePackage.fxml"); final String fxmlText = FXOMDocument.readContentFromURL(fxmlURL); editorController.setFxmlTextAndLocation(fxmlText, fxmlURL, false); SkeletonBuffer skeletonBuffer = new SkeletonBuffer(editorController.getFxomDocument(), "test"); String skeleton = skeletonBuffer.toString(); String firstLine = skeleton.substring(0, skeleton.indexOf("\n")); assertEquals("package com;", firstLine); }
@Test public void testControllerWithAdvancedPackageName() throws IOException { EditorController editorController = new EditorController(); final URL fxmlURL = SkeletonBufferTest.class.getResource("ControllerWithAdvancedPackage.fxml"); final String fxmlText = FXOMDocument.readContentFromURL(fxmlURL); editorController.setFxmlTextAndLocation(fxmlText, fxmlURL, false); SkeletonBuffer skeletonBuffer = new SkeletonBuffer(editorController.getFxomDocument(), "test"); String skeleton = skeletonBuffer.toString(); String firstLine = skeleton.substring(0, skeleton.indexOf("\n")); assertEquals("package com.example.app.view;", firstLine); }