You can check whether a specified State was visited by calling the following command
 

public boolean wasInState(String stateName) {
...
}