Fix for equals() method in Task.java - now works fine to avoid class cast exception