code: private static Number[] toHMS(Measure[] measures) {
          Number[] result = new Number[3];
          int lastIdx = -1;
          for (Measure m : measures) {
              if (m.getNumber().doubleValue() < 0.0) {
                  return null;
              }
              Integer idxObj = hmsTo012.get(m.getUnit());
              if (idxObj == null) {
                  return null;
              }
              int idx = idxObj.intValue();
              if (idx <= lastIdx) {
                  // hour before minute before second
                  return null;
              }
              lastIdx = idx;
              result[idx] = m.getNumber();
          }
          return result;
      }
docs: returned array will be null.