My code runs in intellij on java 17 but returns an error on java 14 for the following line:
if (this.areas.get(i) instanceof Habitat area) {
which returns the error:
java: pattern matching in instanceof is a preview feature and is disabled by default.
How does one adjust this line so it works in java 14? I am aware the way I have used this feature only works in java 16+.