- public boolean triggers(FileState previousState, FileState currentState) {
- return previousState.exists() != currentState.exists();
+ public boolean triggers(State previousState, State currentState) {
+ Preconditions.checkState(previousState instanceof FileState, "previousState is not a FileState");
+ Preconditions.checkState(currentState instanceof FileState, "currentState is not a FileState");
+ return ((FileState) previousState).exists() != ((FileState) currentState).exists();