public NextDirection opposite(){
            switch (this){
                case DOWN:
                    return UP;
                case RIGHT:
                    return LEFT;
                case LEFT:
                    return RIGHT;
                case UP:
                    return DOWN;
                default:
                    throw new IllegalStateException("No opposite of "+this+" available");
            }
        }