Hi. I can't pass the last condition. I've tried many different ideas but don't undersand whats wrong with the move(Apple) method or the checkCollision(GameObject) method in the Snake class. Could somebody help me please?
public void move(Apple apple){
        GameObject head = createNewHead();
        boolean checkCol = checkCollision(head);
        // if(checkCol == true) {
        //    isAlive = false;
            // not change the snakeParts list.
        //}
        if (checkCol == true) isAlive = false;
        else if ( head.x < 0 || head.y < 0 || head.x >= SnakeGame.WIDTH || head.y >= SnakeGame.HEIGHT )
            isAlive = false;
        else{
            snakeParts.add(0, head ); //add createNewHead() to snakeParts at position 0.
            removeTail();
            if(head.x == apple.x && head.y == apple.y ) // if the new snake head's coordinates match the apple's coordinates, you need to set isAlive=false on the apple and not remove the snake's tail. [12]
                apple.isAlive = false;
            /*else {
                if (checkCol == true )
                removeTail();
                else {
                snakeParts.add(0, head ); //add createNewHead() to snakeParts at position 0.
                removeTail(); }
            } */  //////
        }
    }

    ///
    public boolean checkCollision(GameObject obj){
        boolean eatSelf = false; // boolean eatSelf initial value
        for(GameObject segment : snakeParts) { //for (int i = 0; i < snakeParts.size(); i++ ){
            if(segment.x == obj.x && segment.y == obj.y ){ // if ( obj.x == snakeParts.get(i).x && obj.y == snakeParts.get(i).y )
                //return this.eatSelf = true; //return true;
                // break;
                eatSelf = true;
                return eatSelf;
            }
           // else return this.eatSelf= false; //return false;
        }
        return eatSelf;
    }