code: @SuppressWarnings(
     {
        "unchecked"
     }) public static final <E extends Enum<E>> E[] createTypeArray(Class<E> c, int arraySizeOffset)
     {
        EnumSet<E> set = EnumSet.allOf(c);
        E[] array = (E[]) Array.newInstance(c, set.size() + arraySizeOffset);
  
        for (E e : set)
        {
           int index = ((MpxjEnum) e).getValue();
           if (index >= 0)
           {
              array[index] = e;
           }
        }
        return array;
     }
docs: Creates a lookup array based on the "value" associated with an MpxjEnum.
  
  @param <E> target enumeration
  @param c enumeration class
  @param arraySizeOffset offset to apply to the array size
  @return lookup array