package moe.tristan.easyfxml.util;

import org.junit.Test;
import org.testfx.framework.junit.ApplicationTest;

import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

public class NodesTest extends ApplicationTest {

    private static final double MARGIN = 5d;
    private static final int WIDTH_PANE = 200;
    private static final int HEIGHT_PANE = 200;

    private Button testButton;

    @Override
    public void start(final Stage stage) {
        this.testButton = new Button();
        final AnchorPane testPane = new AnchorPane(this.testButton);
        stage.setScene(new Scene(testPane, WIDTH_PANE, HEIGHT_PANE));
        stage.show();
    }

    @Test
    public void centerNode() {
        Nodes.centerNode(this.testButton, MARGIN);
    }
}

package moe.tristan.easyfxml.util;

import org.junit.Test;
import org.testfx.framework.junit.ApplicationTest;

import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

import static org.testfx.assertions.api.Assertions.assertThat;

public class NodesTest extends ApplicationTest {

    private static final double MARGIN = 5d;

    private Pane container;
    private Button testButton;

    @Override
    public void start(final Stage stage) {
        this.testButton = new Button();
        container = new AnchorPane(this.testButton);
        stage.setScene(new Scene(container));
        stage.show();
    }

    @Test
    public void centerNode() {
        Nodes.centerNode(this.testButton, MARGIN);
    }

    @Test
    public void testAutosizeHelpers() {
        final BooleanProperty shouldDisplay = new SimpleBooleanProperty(true);
        final Button testButton = new Button();
        Nodes.hideAndResizeParentIf(testButton, shouldDisplay);

        assertThat(testButton.isManaged()).isTrue();
        assertThat(testButton.isVisible()).isTrue();

        shouldDisplay.setValue(false);
        assertThat(testButton.isManaged()).isFalse();
        assertThat(testButton.isVisible()).isFalse();
    }
}

Add tests for new node utility methods
Add tests for new node utility methods
