java – Akka FSM: Traffic lights implementation

Recently I did an exercise to understand Akka FSM. I implemented a traffic light system with Akka FSM that changes its status every 30 seconds.

My code is like:

LightColour: Enum to encapsulate traffic light colors.

public enum LightColour {
    RED,
    YELLOW,
    GREEN
}

Light: Class to represent real light.

public class Light {

    private LightColour lightColourNow;

    private long lightStartedAt;

    private long numberOfChanges;

    public Light(LightColour lightColourNow) {
        this.lightColourNow = lightColourNow;
        this.lightStartedAt = System.currentTimeMillis();
        this.numberOfChanges = 0;
    }

    public LightColour getLightColourNow() {
        return lightColourNow;
    }

    public long getLightStartedAt() {
        return lightStartedAt;
    }

    public long getNumberOfChanges() {
        return numberOfChanges;
    }

    public long changeLightColor(LightColour lightColourNow) {
        System.out.println(String.format("Changing Light colour from %s to %s. Change Number: %d", this.lightColourNow, lightColourNow, this.numberOfChanges));
        this.lightColourNow = lightColourNow;
        this.numberOfChanges++;
        return numberOfChanges;
    }

    @Override
    public String toString() {
        return "LightTimeout{" +
                "lightColourNow=" + lightColourNow +
                ", lightStartedAt=" + lightStartedAt +
                ", numberOfChanges=" + numberOfChanges +
                '}';
    }
}

LightTimeout: An empty class to denote the event to change the light.

public class LightTimeout {
}

Finally the TrafficLight class, which is an FSM to represent the behavior of a traffic light, changing colors every 30 seconds.

import akka.actor.AbstractFSM;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;

import java.io.IOException;
import java.time.Duration;


public class TrafficLight extends AbstractFSM {

    private final int LIGHT_TIME = 30;

    public static Props props() {
        return Props.create(TrafficLight.class);
    }

    {
        startWith(LightColour.RED, new Light(LightColour.RED));

        when(LightColour.RED, matchEvent(LightTimeout.class, ((timeOut, data) -> {
            data.changeLightColor(LightColour.YELLOW);
            scheduleTimeoutEvent();
            return goTo(LightColour.YELLOW);
        })));

        when(LightColour.YELLOW, matchEvent(LightTimeout.class, (timeOut, data) -> {
            data.changeLightColor(LightColour.GREEN);
            scheduleTimeoutEvent();
            return goTo(LightColour.GREEN);
        }));

        when(LightColour.GREEN, matchEvent(LightTimeout.class, (timeOut, data) -> {
            data.changeLightColor(LightColour.RED);
            scheduleTimeoutEvent();
            return goTo(LightColour.RED);
        }));

        scheduleTimeoutEvent();
        initialize();
    }

    private void scheduleTimeoutEvent() {
        context().system().scheduler().scheduleOnce(Duration.ofSeconds(LIGHT_TIME), getSelf(), new LightTimeout(), context().dispatcher(), getSelf());
    }


    public static void main(String() args) throws IOException {
        ActorSystem actorSystem = ActorSystem.create("traffic-light-system");
        ActorRef actorRef = actorSystem.actorOf(TrafficLight.props());
        System.out.println("Press any key to exit");
        System.in.read();
        actorSystem.stop(actorRef);
        actorSystem.terminate();
    }
} 

I am looking for a review of the solution from Java, as well as from Akka's perspective. Is my solution ok considering how I have used Akka FSM or can I improve the solution?