Index: trunk/src/javax/json/JsonArray.java
===================================================================
--- trunk/src/javax/json/JsonArray.java	(revision 6756)
+++ trunk/src/javax/json/JsonArray.java	(revision 13231)
@@ -2,5 +2,5 @@
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2011-2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011-2017 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
@@ -9,10 +9,10 @@
  * may not use this file except in compliance with the License.  You can
  * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt.  See the License for the specific
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt.  See the License for the specific
  * language governing permissions and limitations under the License.
  *
  * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
+ * file and include the License file at LICENSE.txt.
  *
  * GPL Classpath Exception:
@@ -42,4 +42,7 @@
 
 import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
@@ -111,6 +114,4 @@
  * whether directly or using its collection views, results in an 
  * {@code UnsupportedOperationException}.
- *
- * @author Jitendra Kotamraju
  */
 public interface JsonArray extends JsonStructure, List<JsonValue> {
@@ -165,5 +166,5 @@
 
     /**
-     * Returns a list a view of the specified type for the array. This method
+     * Returns a list view of the specified type for the array. This method
      * does not verify if there is a value of wrong type in the array. Providing
      * this typesafe view dynamically may cause a program fail with a
@@ -172,8 +173,35 @@
      * method returns.
      *
+     * @param <T> The type of the List for the array
      * @param clazz a JsonValue type
-     * @return a list view of the  specified type
+     * @return a list view of the specified type
      */
     <T extends JsonValue> List<T> getValuesAs(Class<T> clazz);
+
+    /**
+     * Returns a list view for the array. The value and the type of the elements
+     * in the list is specified by the {@code func} argument.
+     * <p>This method can be used to obtain a list of the unwrapped types, such as
+     * <pre>{@code
+     *     List<String> strings = ary1.getValuesAs(JsonString::getString);
+     *     List<Integer> ints = ary2.getValuesAs(JsonNumber::intValue);
+     * } </pre>
+     * or a list of simple projections, such as
+     * <pre> {@code
+     *     List<Integer> stringsizes = ary1.getValueAs((JsonString v)->v.getString().length();
+     * } </pre>
+     * @param <K> The element type (must be a subtype of JsonValue) of this JsonArray.
+     * @param <T> The element type of the returned List
+     * @param func The function that maps the elements of this JsonArray to the target elements.
+     * @return A List of the specified values and type.
+     * @throws ClassCastException if the {@code JsonArray} contains a value of wrong type
+     *
+     * @since 1.1
+     */
+    default <T, K extends JsonValue> List<T> getValuesAs(Function<K, T> func) {
+        @SuppressWarnings("unchecked")
+        Stream<K> stream = (Stream<K>) stream();
+        return stream.map(func).collect(Collectors.toList());
+    }
 
     /**
@@ -195,5 +223,7 @@
      * the specified default value is returned.
      *
-     * @param index index of the JsonString value
+     * @param index index of the {@code JsonString} value
+     * @param defaultValue the String to return if the {@code JsonValue} at the
+     *    specified position is not a {@code JsonString}
      * @return the String value at the specified position in this array,
      * or the specified default value
@@ -220,4 +250,6 @@
      *
      * @param index index of the {@code JsonNumber} value
+     * @param defaultValue the int value to return if the {@code JsonValue} at
+     *     the specified position is not a {@code JsonNumber}
      * @return the int value at the specified position in this array,
      * or the specified default value
@@ -247,4 +279,6 @@
      *
      * @param index index of the JSON boolean value
+     * @param defaultValue the boolean value to return if the {@code JsonValue}
+     *    at the specified position is neither TRUE nor FALSE
      * @return the boolean value at the specified position,
      * or the specified default value
@@ -258,8 +292,7 @@
      * @param index index of the JSON null value
      * @return return true if the value at the specified location is
-     * {@code JsonValue.NUL}, otherwise false
+     * {@code JsonValue.NULL}, otherwise false
      * @throws IndexOutOfBoundsException if the index is out of range
      */
     boolean isNull(int index);
-
 }
