this is once piece of code : import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Random;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class Minion extends Dot{
    private int health; 
    private NeuralNetwork neuralNetwork;
    private Random random = new Random();
    public Minion(int x, int y, int size, int speedx, int speedy, Color color, int health,NeuralNetwork neuralNetwork)
    {
    super(x,  y,  size, speedx, speedy,color);
    this.health = health;
    this.neuralNetwork = neuralNetwork;
    }

    public void move(ArrayList<Food> foods) {
        double nearestFoodDistance = Double.MAX_VALUE;
        Food nearestFood = null;
        for (Food food : foods) {
        double distance = Math.sqrt(Math.pow(x - food.x, 2) + Math.pow(y - food.y, 2));
        if (distance < nearestFoodDistance) {
        nearestFoodDistance = distance;
        nearestFood = food;
        }
        // Remove consumed food from ArrayList
        if (distance < size/2 + food.size/2) {
        health += food.food_value;
        foods.remove(food);
        }
        }
        // Move towards nearest food if there is one
        if (nearestFood != null) {
        double dx = nearestFood.x - x;
        double dy = nearestFood.y - y;
        double angle = Math.atan2(dy, dx);
        speedx = (int) (Math.cos(angle) * 5);
        speedy = (int) (Math.sin(angle) * 5);
        x += speedx;
        y += speedy;
        }
        health -= 1;
        if(health <=0 )
        {
            
        }
        }
    }
 there is another : 

import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Random;
import javax.swing.JFrame;
import javax.swing.JPanel;


public class SlowDots extends JPanel implements Runnable {

private ArrayList<Dot> dots = new ArrayList<>();
private ArrayList<Food> foods = new ArrayList<>();
private ArrayList<Minion> minions = new ArrayList<>();
private Random random = new Random();

public SlowDots() {
setBackground(Color.BLACK);
for (int i = 0; i < 2; i++) {
foods.add(new Food(random.nextInt(1860)+10, random.nextInt(980)+10, random.nextInt(5)+2, random.nextInt(3) -1,random.nextInt(3) -1));
int[] numNeuronsInHiddenLayers = {2};
NeuralNetwork neuralNet = new NeuralNetwork(2, 1, numNeuronsInHiddenLayers, 1);
Minion newMinion = new Minion(10, 10, 10, 2, 2, Color.BLUE, 100, neuralNet);
minions.add(newMinion);
System.out.println(foods.get(i).x);
System.out.println(foods.get(i).y);
System.out.println(foods.get(i).size);
}
new Thread(this).start();
}

@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
for (Minion minion : minions) {
    minion.move(foods);
g.setColor(minion.color);
g.fillOval(minion.x, minion.y, minion.size, minion.size);
}
for (Food food : foods) {
    g.setColor(food.color);
    g.fillOval(food.x, food.y, food.size, food.size);
    }
}

@Override
public void run() {
    thread2.start();
while (true) {
dot_movement();
dot_movement_changer();
//foods.add(new Food(random.nextInt(1860)+10, random.nextInt(980)+10, random.nextInt(5)+2, random.nextInt(3) -1,random.nextInt(3) -1));
repaint();
try {
Thread.sleep(50);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
Thread thread2 = new Thread(){
    public void run(){
        while(true){
        foods.add(new Food(random.nextInt(1860)+10, random.nextInt(980)+10, random.nextInt(5)+2, random.nextInt(3) -1,random.nextInt(3) -1));
        try {
        thread2.sleep(800);
        }catch(InterruptedException e)
        {
            e.printStackTrace();
        }
    }
    }
};
public static void main(String[] args) {
JFrame frame = new JFrame("Slow Dots");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(1880, 1000);
frame.setContentPane(new SlowDots());
frame.setVisible(true);
}
public void dot_movement()
{
    for (Dot dot : dots) {
        dot.x += dot.speedx;
        if (dot.x > getWidth()) {
        dot.x = 0;
        }else if(dot.x <0)
        {
            dot.x = getWidth();
        }
        dot.y += dot.speedy;
        if (dot.y > getHeight()) {
        dot.y = 0;
        }else if(dot.y <0)
        {
            dot.y = getHeight();
        }
        }
}
public void dot_movement_changer()
{
    for(Dot dot: dots)
{
    dot.speedx += random.nextInt(3) -1;
    dot.speedy+= random.nextInt(3)-1;
}
}
public void removeMinion(Minion minion)
{
 minions.remove(minion);
}
}
 how do i fix error : Cannot make a static reference to the non-static method removeMinion(Minion) from the type SlowDots