This usage is generally discouraged,[3] since it can lead to confusion as to whether a given quantity expressed in newton-metres is a torque or a quantity of energy.
Java obviously takes the different quaqntity of Energy vs. Torque into consideration. So the composition could be the same, but they never will be equal, probably not even equivalent since that requires the same quantity type.
Based on https://github.com/unitsofmeasurement/indriya/issues/257#issuecomment-532363116 there could be a need for some special handling of the Newton-metre, because like Wikipedia also states:
Java obviously takes the different quaqntity of
Energy
vs.Torque
into consideration. So the composition could be the same, but they never will be equal, probably not even equivalent since that requires the same quantity type.