Collision detection. I cant get this to work

I am trying to make a program that spawns the amount of balls you type in.

Half of the balls spawn in the left (team blue) side and the other half spawn in the right side (team orange). Each ball has to reach the opposite side without colliding with any of the balls. To be able to do that, I first need to be able to make the code know when/if it will collide with another ball.

In my Ball class I get the collision detection to work, but I don't know how to solve the problem. I haven't tried to call it from the GUI class but I don't know how I would do that either.

I've been looking at this link for help: Checking Collision of Shapes with JavaFX

But it didn't help. Please suggest.

Ball.java

package fx;

import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Shape;
import javafx.util.Duration;
import javafx.scene.shape.*;


public class Ball {

    public static int id;
    public Circle circle;
    public int team;

    public Ball(int x, int y, int _id, int _team) {

        id = _id;

        Circle ball = new Circle(10, Color.BLACK);
        ball.relocate(x, y);
        circle = ball;

        team = _team;
    }


    public void moveBall() {
        System.out.println(this.team);

        //team blue
        if (this.team == 0) {
            Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(3),
                      new KeyValue(this.circle.layoutXProperty(), 
                              980-((Circle)this.circle).getRadius())));

            timeline.setAutoReverse(true);
            timeline.setCycleCount(Timeline.INDEFINITE);
            timeline.play();

        }//team orange
        else if (this.team == 1) {
            //System.out.println(this.circle.layoutXProperty());

            Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(3),
                      new KeyValue(this.circle.layoutXProperty(), 
                              35-((Circle)this.circle).getRadius())));
            timeline.setAutoReverse(true);
            timeline.setCycleCount(Timeline.INDEFINITE);
            timeline.play();
        }
    }

    public Circle getCircle() {
        return this.circle;
    }




    //collision detection

    public void collisionDetection(Shape balls) {
        boolean collisionDetected = false;
        for(Shape static_bloc : circle) {
            if(static_bloc != balls) {

                Shape intersect = Shape.intersect(balls,  static_bloc);
                if (intersect.getBoundsInLocal().getWidth() != -1){
                    collisionDetected = true;
                }
            }
        }

        if(collisionDetected) {



        }else {



        }
    }

}

GUI.java

package fx;

import javafx.animation.KeyFrame;
import javafx.scene.control.TextField;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.geometry.Bounds;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Slider;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
import javafx.util.Duration;
import java.util.Random;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public  class GUI extends Application {

    public static void main (String[] args) {
        Application.launch(args);
    }


    @Override
    public void start(Stage primaryStage) throws Exception {

        Pane canvas = new Pane();

        Scene scene = new Scene(canvas,1000, 500);

        Bounds bounds = canvas.getBoundsInLocal();

        HBox hbox = new HBox();
        hbox.setStyle("-fx-background-color: grey");
        hbox.setPrefSize(1000, 40);
        hbox.setLayoutX(0);
        hbox.setLayoutY(460);

        TextField NrInput = new TextField("");
        NrInput.setPromptText("Total amount of balls:");
        NrInput.setPrefHeight(40);


        Button startBtn = new Button("Start");
        startBtn.setPrefWidth(70);
        startBtn.setPrefHeight(40);
        startBtn.setOnAction(e ->{
            startBtn.setDisable(true);

            //list with balls. lista med bollar
            ArrayList<Ball> balls = new ArrayList<>();

            // Get text
            // Do a check. Gör typkontroll
            int ballCount = Integer.parseInt(NrInput.getText());


            Random r = new Random();
            int Low = 20;
            int High = 420;
            int id = 0;
            //System.out.println(bounds.getMaxX());

            for (int i = 0; i < ballCount; i++) {
                Ball ball;

                // Randomize Y
                int y = r.nextInt(High-Low) + Low;

                //every other ball gets in different teams
                if (i % 2 == 0) {
                    ball = new Ball(25, y, id, 0);

                } else {
                    ball = new Ball(955, y, id, 1);

                }
                balls.add(ball);
                canvas.getChildren().add(ball.getCircle());

                id = id + 1;

            }

            for (Ball b : balls) {
                b.moveBall();
            }


            startBtn.setDisable(false);
        });


        Button restartBtn = new Button("Restart");
        restartBtn.setPrefWidth(70);
        restartBtn.setPrefHeight(40);
        restartBtn.setOnAction(e -> {

        });

        Button exitBtn  = new Button("Exit");
        exitBtn.setPrefWidth(70);
        exitBtn.setPrefHeight(40);
        exitBtn.setOnAction(e -> primaryStage.close());

        HBox spawnBlue = new HBox();
        spawnBlue.setPrefHeight(420);
        spawnBlue.setPrefWidth(30);
        spawnBlue.setLayoutX(20);
        spawnBlue.setLayoutY(20);
        spawnBlue.setStyle("-fx-background-color: blue");

        HBox spawnOrange = new HBox();
        spawnOrange.setPrefHeight(420);
        spawnOrange.setPrefWidth(30);
        spawnOrange.setLayoutX(950);
        spawnOrange.setLayoutY(20);
        spawnOrange.setStyle("-fx-background-color: orange");

        canvas.getChildren().add(hbox);
        canvas.getChildren().add(spawnOrange);
        canvas.getChildren().add(spawnBlue);

        hbox.getChildren().add(startBtn);
        hbox.getChildren().add(NrInput);
        hbox.getChildren().add(restartBtn);
        hbox.getChildren().add(exitBtn);


        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public void runTask() {

    }

}`