code: public Double getProcessorMetric(String processorNumber, ID metricToCollect) {
  
          CentralProcessor processor = getProcessor();
          if (processor == null) {
              return null;
          }
  
          int processorIndex;
          try {
              processorIndex = Integer.parseInt(processorNumber);
              if (processorIndex < 0 || processorIndex >= processor.getLogicalProcessorCount()) {
                  return null;
              }
          } catch (Exception e) {
              return null;
          }
  
          if (PlatformMetricType.PROCESSOR_CPU_USAGE.getMetricTypeId().equals(metricToCollect)) {
              return processor.getProcessorCpuLoadBetweenTicks()[processorIndex];
          } else {
              throw new UnsupportedOperationException("Invalid processor metric to collect: " + metricToCollect);
          }
      }
docs: Returns the given metric's value, or null if there is no processor with the given number.
  
  @param processorNumber number of the processor, as a String
  @param metricToCollect the metric to collect
  @return the value of the metric, or null if there is no processor with the given number