1) I refactored the
UCUMFormat.format(Unit, Appendable) method into smaller junks, then isolated the processing of Kilogram in a separated method.
2) I've added a helper class UCUMFormatHelper to replace UnitConverters that are not detectable as prefixes by the formatter with ones that are.
Part 2 is not pretty and feels more like a workaround, but it fixes some unit tests.
I basically solved this with 2 steps
1) I refactored the
UCUMFormat.format(Unit, Appendable)
method into smaller junks, then isolated the processing of Kilogram in a separated method. 2) I've added a helper classUCUMFormatHelper
to replace UnitConverters that are not detectable as prefixes by the formatter with ones that are.Part 2 is not pretty and feels more like a workaround, but it fixes some unit tests.
This change is