unit tests and fix to Duration.hashCode()