code: public <T> T[] nextArray(String expectedName, @NonNull Class<T> elementType) throws IOException {
        beginArray(expectedName);
        List<T> array = new ArrayList<>();
        while (peek() != JsonTokenType.END_ARRAY) {
           array.add(nextValue(elementType));
        }
        endArray();
        return array.toArray(Cast.as(Array.newInstance(elementType, array.size())));
     }
docs: Reads the next array with an expected name and returns a list of its values
  
  @param <T>          the component type of the array
  @param expectedName The name that the next array should have
  @param elementType  class information for the component type
  @return the array
  @throws IOException Something went wrong reading the array