This is relative to JScience v3.3-Beta (Feb. 12, 2007 build).
Is it intentional that Measure equals() is not consistent with compareTo()?
(Consistent as described in the Comparable interface's javadocs.)
Whether "1000 m" should be equals to "1 km", does seem to have some non-obvious
wrinkles. From a layman's viewpoint it would seem true would be the answer.
However, from an OO techie's viewpoint, who knew that the two Measure objects
have different unit values ("m" vs. "km"), false might be the answer.
I mostly lean to the layman's viewpoint for a couple reasons. First, if I asked
someone if 1000m was equal to 1km they would say yes. Second, having equals()
and compareTo() be consistent is a desirable thing, and it seems that
compareTo() should return 0 (equality). The second point does contain a degree
of "self defining truism" in its reasoning.
To support strict equality checks, there could be a different method for that
(e.g. strictEquals() or something like that).
I will attach a simple Java class as an example.