1 // Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file 2 // for details. All rights reserved. Use of this source code is governed by a 3 // BSD-style license that can be found in the LICENSE file. 4 package memberrebinding2; 5 6 import java.util.ArrayList; 7 import java.util.Arrays; 8 9 public class ClassExtendsLibraryClass extends ArrayList<String> { 10 addOnArrayList(ArrayList<T> list, T item)11 private static <T> void addOnArrayList(ArrayList<T> list, T item) { 12 list.add(item); 13 } 14 methodThatAddsHelloWorldUsingAddAll()15 public void methodThatAddsHelloWorldUsingAddAll() { 16 // call this only on this type, so that it cannot be rebound to the interface. 17 String[] words = new String[]{"hello", "world"}; 18 addAll(Arrays.asList(words)); 19 } 20 21 } 22