code: public static Object instantiatePrimitiveArray(Class<?> type, String[] values) {
          logger.entering(new Object[] { type, values });
  
          validateParams(type, values);
          checkArgument(isPrimitiveArray(type), type + " is NOT a primitive array type.");
  
          Class<?> componentType = type.getComponentType();
          Object arrayToReturn = Array.newInstance(componentType, values.length);
          Method parserMethod = getParserMethod(componentType);
          for (int i = 0; i < values.length; i++) {
              try {
                  Array.set(arrayToReturn, i, parserMethod.invoke(arrayToReturn, values[i]));
              } catch (ArrayIndexOutOfBoundsException | IllegalArgumentException | IllegalAccessException
                      | InvocationTargetException e) {
                  throw new ReflectionException(e);
              }
          }
          logger.exiting(arrayToReturn);
          return arrayToReturn;
      }
docs: This helper method facilitates creation of primitive arrays and pre-populates them with the set of String values
  provided.
  
  @param type
  The type of the array to create. Note that this method will only accept primitive types (as the name
  suggests) i.e., only int[],float[], boolean[] and so on.
  @param values
  A {@link String} array that represents the set of values that should be used to pre-populate the
  newly constructed array.
  
  @return An array of the type that was specified.