final TimeUnit[] values = TimeUnit.values();
for (int j = 0; j < values.length; ++j) {
final TimeUnit timeUnit = values[j];
double[] tests = {0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 5, 10, 100, 101.35};
for (int i = 0; i < tests.length; ++i) {
TimeUnitAmount source = new TimeUnitAmount(tests[i], timeUnit);
String formatted = ((TimeUnitFormat)formats[style]).format(source);
//System.out.println(formatted);
logln(tests[i] + " => " + formatted);
try {
TimeUnitAmount result = (TimeUnitAmount) ((TimeUnitFormat)formats[style]).parseObject(formatted);
if (result == null || !source.equals(result)) {
errln("No round trip: " + source + " => " + formatted + " => " + result);
}
// mix style parsing
result = (TimeUnitAmount) ((TimeUnitFormat)formats[1 - style]).parseObject(formatted);