code: public static <T extends EntryValue> T[] sortEntriesToValues(List<Entry<T>> entryList) {
          int len = 0;
          T[] valArray = null;
          
          if (entryList == null) {
              return valArray;
          }
          
          for (Entry<T> e : entryList) {
              len += e.size();
          }
          
          if (len == 0) {
              return valArray;
          }
          
          // Create valArray
          valArray = entryList.get(0).getValueFactory().newValueArray(len);
          
          // Add values from entries to valArray
          int i = 0;
          for (Entry<T> e : entryList) {
              for (T val : e.getValueList()) {
                  valArray[i++] = val;
              }
          }
          
          // Sort values in valArray
          Arrays.sort(valArray);
          return valArray;
      }
docs: Sort all the EntryValue(s) from an Entry list into an array of
  EntryValue(s).
  
  @param <T>
  a generic type for EntryValue.
  @param entryList
  an Entry list from whose EntryValue(s) will be sorted.
  
  @return an array of EntryValue(s) of generic type <T>. Returns null if
  the entryList is null or it does not contain any values
  
  @throws NullPointerException
  if the first Entry in the list is null.