1 /*
   2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @summary Test of method selection and resolution cases that
  27  * generate AbstractMethodErrorTest
  28  * @library /runtime/SelectionResolution/classes
  29  * @build selectionresolution.*
  30  * @run main/othervm/timeout=300 -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies AbstractMethodErrorTest
  31  */
  32 
  33 import java.util.Arrays;
  34 import java.util.Collection;
  35 import java.util.EnumSet;
  36 import selectionresolution.ClassData;
  37 import selectionresolution.MethodData;
  38 import selectionresolution.Result;
  39 import selectionresolution.SelectionResolutionTest;
  40 import selectionresolution.SelectionResolutionTestCase;
  41 import selectionresolution.Template;
  42 
  43 public class AbstractMethodErrorTest extends SelectionResolutionTest {
  44 
  45     private static final SelectionResolutionTestCase.Builder initBuilder =
  46         new SelectionResolutionTestCase.Builder();
  47 
  48     static {
  49         initBuilder.setResult(Result.AME);
  50     }
  51 
  52     private static final Collection<TestGroup> testgroups =
  53         Arrays.asList(
  54                 /* invokevirtual tests */
  55                 /* Group 63: callsite = methodref = expected */
  56                 new TestGroup.Simple(initBuilder,
  57                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
  58                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
  59                                              EnumSet.of(MethodData.Access.PUBLIC,
  60                                                         MethodData.Access.PACKAGE,
  61                                                         MethodData.Access.PROTECTED,
  62                                                         MethodData.Access.PRIVATE),
  63                                              EnumSet.of(MethodData.Context.ABSTRACT),
  64                                              EnumSet.of(ClassData.Package.SAME)),
  65                         Template.MethodrefEqualsExpected,
  66                         Template.ReabstractExpectedClass,
  67                         Template.CallsiteEqualsMethodref,
  68                         Template.MethodrefSelectionResolvedIsClass),
  69                 /* Group 64: callsite = methodref, methodref != expected,
  70                  * expected is class, expected and callsite in the same package
  71                  */
  72                 new TestGroup.Simple(initBuilder,
  73                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
  74                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
  75                                              EnumSet.of(MethodData.Access.PUBLIC,
  76                                                         MethodData.Access.PROTECTED),
  77                                              EnumSet.of(MethodData.Context.ABSTRACT),
  78                                              EnumSet.of(ClassData.Package.SAME)),
  79                         Template.MethodrefNotEqualsExpectedClass,
  80                         Template.ReabstractExpectedClass,
  81                         Template.CallsiteEqualsMethodref,
  82                         Template.MethodrefSelectionResolvedIsClass),
  83                 /* Group 65: callsite = methodref = resolved, possibly
  84                  * skip different package in selection.
  85                  */
  86                 new TestGroup.Simple(initBuilder,
  87                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
  88                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
  89                                              EnumSet.of(MethodData.Access.PACKAGE),
  90                                              EnumSet.of(MethodData.Context.ABSTRACT),
  91                                              EnumSet.of(ClassData.Package.SAME)),
  92                         Template.MethodrefNotEqualsExpectedClass,
  93                         Template.ReabstractExpectedClass,
  94                         Template.CallsiteEqualsMethodref,
  95                         Template.MethodrefSelectionPackageSkipNoOverride),
  96                 /* Group 66: callsite = methodref, methodref != expected,
  97                  * expected is interface, expected and callsite in the same package
  98                  */
  99                 new TestGroup.Simple(initBuilder,
 100                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 101                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 102                                              EnumSet.of(MethodData.Access.PUBLIC),
 103                                              EnumSet.of(MethodData.Context.ABSTRACT),
 104                                              EnumSet.of(ClassData.Package.SAME)),
 105                         Template.MethodrefNotEqualsExpectedIface,
 106                         Template.ReabstractExpectedIface,
 107                         Template.CallsiteEqualsMethodref,
 108                         Template.MethodrefSelectionResolvedIsIface),
 109                 /* Group 67: callsite :> methodref, methodref = expected,
 110                  * expected is class, expected and callsite in the same package
 111                  */
 112                 new TestGroup.Simple(initBuilder,
 113                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 114                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 115                                              EnumSet.of(MethodData.Access.PUBLIC,
 116                                                         MethodData.Access.PROTECTED),
 117                                              EnumSet.of(MethodData.Context.ABSTRACT),
 118                                              EnumSet.of(ClassData.Package.SAME)),
 119                         Template.MethodrefEqualsExpected,
 120                         Template.ReabstractExpectedClass,
 121                         Template.CallsiteSubclassMethodref,
 122                         Template.MethodrefSelectionResolvedIsClass),
 123                 /* Group 68: callsite :> methodref, methodref = expected,
 124                  * possibly skip different package in selection.
 125                  */
 126                 new TestGroup.Simple(initBuilder,
 127                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 128                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 129                                              EnumSet.of(MethodData.Access.PACKAGE),
 130                                              EnumSet.of(MethodData.Context.ABSTRACT),
 131                                              EnumSet.of(ClassData.Package.SAME)),
 132                         Template.MethodrefEqualsExpected,
 133                         Template.ReabstractExpectedClass,
 134                         Template.CallsiteSubclassMethodref,
 135                         Template.MethodrefSelectionPackageSkipNoOverride),
 136                 /* Group 69: callsite :> methodref, methodref != expected,
 137                  * expected is class, expected and callsite in the same package
 138                  */
 139                 new TestGroup.Simple(initBuilder,
 140                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 141                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 142                                              EnumSet.of(MethodData.Access.PUBLIC,
 143                                                         MethodData.Access.PACKAGE,
 144                                                         MethodData.Access.PROTECTED),
 145                                              EnumSet.of(MethodData.Context.ABSTRACT),
 146                                              EnumSet.of(ClassData.Package.SAME)),
 147                         Template.MethodrefNotEqualsExpectedClass,
 148                         Template.ReabstractExpectedClass,
 149                         Template.CallsiteSubclassMethodref,
 150                         Template.MethodrefSelectionResolvedIsClass),
 151                 /* Group 70: callsite :> methodref, methodref != expected,
 152                  * possibly skip different package in selection
 153                  */
 154                 new TestGroup.Simple(initBuilder,
 155                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 156                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 157                                              EnumSet.of(MethodData.Access.PACKAGE),
 158                                              EnumSet.of(MethodData.Context.ABSTRACT),
 159                                              EnumSet.of(ClassData.Package.SAME)),
 160                         Template.MethodrefNotEqualsExpectedClass,
 161                         Template.ReabstractExpectedClass,
 162                         Template.CallsiteSubclassMethodref,
 163                         Template.MethodrefSelectionPackageSkipNoOverride),
 164                 /* Group 71: callsite :> methodref, methodref != expected,
 165                  * expected is interface, expected and callsite in the same package
 166                  */
 167                 new TestGroup.Simple(initBuilder,
 168                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 169                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 170                                              EnumSet.of(MethodData.Access.PUBLIC),
 171                                              EnumSet.of(MethodData.Context.ABSTRACT),
 172                                              EnumSet.of(ClassData.Package.SAME)),
 173                         Template.MethodrefNotEqualsExpectedIface,
 174                         Template.ReabstractExpectedIface,
 175                         Template.CallsiteSubclassMethodref,
 176                         Template.MethodrefSelectionResolvedIsIface),
 177                 /* Group 72: callsite unrelated to methodref, methodref = expected,
 178                  * expected is class, expected and callsite in the same package
 179                  */
 180                 new TestGroup.Simple(initBuilder,
 181                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 182                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 183                                              EnumSet.of(MethodData.Access.PUBLIC),
 184                                              EnumSet.of(MethodData.Context.ABSTRACT),
 185                                              EnumSet.of(ClassData.Package.SAME)),
 186                         Template.MethodrefEqualsExpected,
 187                         Template.ReabstractExpectedClass,
 188                         Template.CallsiteUnrelatedToMethodref,
 189                         Template.MethodrefSelectionResolvedIsClass),
 190                 /* Group 73: callsite unrelated to methodref, methodref = expected,
 191                  * expected is class, expected and callsite in the same package
 192                  */
 193                 new TestGroup.Simple(initBuilder,
 194                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 195                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 196                                              EnumSet.of(MethodData.Access.PACKAGE),
 197                                              EnumSet.of(MethodData.Context.ABSTRACT),
 198                                              EnumSet.of(ClassData.Package.SAME)),
 199                         Template.MethodrefEqualsExpected,
 200                         Template.ReabstractExpectedClass,
 201                         Template.CallsiteUnrelatedToMethodref,
 202                         Template.MethodrefSelectionPackageSkipNoOverride),
 203                 /* Group 74: callsite unrelated to methodref, methodref != expected,
 204                  * expected is class, expected and callsite in the same package
 205                  */
 206                 new TestGroup.Simple(initBuilder,
 207                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 208                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 209                                              EnumSet.of(MethodData.Access.PUBLIC),
 210                                              EnumSet.of(MethodData.Context.ABSTRACT),
 211                                              EnumSet.of(ClassData.Package.SAME)),
 212                         Template.MethodrefNotEqualsExpectedClass,
 213                         Template.ReabstractExpectedClass,
 214                         Template.CallsiteUnrelatedToMethodref,
 215                         Template.MethodrefSelectionResolvedIsClass),
 216                 /* Group 75: callsite unrelated to methodref, methodref != expected,
 217                  * expected is class, expected and callsite in the same package
 218                  */
 219                 new TestGroup.Simple(initBuilder,
 220                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 221                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 222                                              EnumSet.of(MethodData.Access.PACKAGE),
 223                                              EnumSet.of(MethodData.Context.ABSTRACT),
 224                                              EnumSet.of(ClassData.Package.SAME)),
 225                         Template.MethodrefNotEqualsExpectedClass,
 226                         Template.ReabstractExpectedClass,
 227                         Template.CallsiteUnrelatedToMethodref,
 228                         Template.MethodrefSelectionPackageSkipNoOverride),
 229                 /* Group 76: callsite unrelated to methodref, methodref != expected,
 230                  * expected is interface, expected and callsite in the same package
 231                  */
 232                 new TestGroup.Simple(initBuilder,
 233                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 234                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 235                                              EnumSet.of(MethodData.Access.PUBLIC),
 236                                              EnumSet.of(MethodData.Context.ABSTRACT),
 237                                              EnumSet.of(ClassData.Package.SAME)),
 238                         Template.MethodrefNotEqualsExpectedIface,
 239                         Template.ReabstractExpectedIface,
 240                         Template.CallsiteUnrelatedToMethodref,
 241                         Template.MethodrefSelectionResolvedIsIface),
 242                 /* Group 77: callsite = methodref, methodref != expected,
 243                  * expected is class, expected and callsite not in the same package
 244                  */
 245                 new TestGroup.Simple(initBuilder,
 246                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 247                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 248                                              EnumSet.of(MethodData.Access.PUBLIC),
 249                                              EnumSet.of(MethodData.Context.ABSTRACT),
 250                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 251                         Template.MethodrefNotEqualsExpectedClass,
 252                         Template.ReabstractExpectedClass,
 253                         Template.CallsiteEqualsMethodref,
 254                         Template.MethodrefSelectionResolvedIsClass),
 255                 /* Group 78: callsite = methodref, methodref != expected,
 256                  * expected is interface, expected and callsite not in the same package
 257                  */
 258                 new TestGroup.Simple(initBuilder,
 259                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 260                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 261                                              EnumSet.of(MethodData.Access.PUBLIC),
 262                                              EnumSet.of(MethodData.Context.ABSTRACT),
 263                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 264                         Template.MethodrefNotEqualsExpectedIface,
 265                         Template.ReabstractExpectedIface,
 266                         Template.CallsiteEqualsMethodref,
 267                         Template.MethodrefSelectionResolvedIsIface),
 268                 /* Group 79: callsite :> methodref, methodref = expected,
 269                  * expected is class, expected and callsite not in the same package
 270                  */
 271                 new TestGroup.Simple(initBuilder,
 272                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 273                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 274                                              EnumSet.of(MethodData.Access.PUBLIC),
 275                                              EnumSet.of(MethodData.Context.ABSTRACT),
 276                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 277                         Template.MethodrefEqualsExpected,
 278                         Template.ReabstractExpectedClass,
 279                         Template.CallsiteSubclassMethodref,
 280                         Template.MethodrefSelectionResolvedIsClass),
 281 
 282                 /* Group 80: callsite :> methodref, methodref != expected,
 283                  * expected is class, expected and callsite not in the same package
 284                  */
 285                 new TestGroup.Simple(initBuilder,
 286                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 287                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 288                                              EnumSet.of(MethodData.Access.PUBLIC),
 289                                              EnumSet.of(MethodData.Context.ABSTRACT),
 290                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 291                         Template.MethodrefNotEqualsExpectedClass,
 292                         Template.ReabstractExpectedClass,
 293                         Template.CallsiteSubclassMethodref,
 294                         Template.MethodrefSelectionResolvedIsClass),
 295                 /* Group 81: callsite :> methodref, methodref != expected,
 296                  * expected is interface, expected and callsite not in the same package
 297                  */
 298                 new TestGroup.Simple(initBuilder,
 299                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 300                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 301                                              EnumSet.of(MethodData.Access.PUBLIC),
 302                                              EnumSet.of(MethodData.Context.ABSTRACT),
 303                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 304                         Template.MethodrefNotEqualsExpectedIface,
 305                         Template.ReabstractExpectedIface,
 306                         Template.CallsiteSubclassMethodref,
 307                         Template.MethodrefSelectionResolvedIsIface),
 308                 /* Group 82: callsite unrelated to methodref, methodref = expected,
 309                  * expected is class, expected and callsite not in the same package
 310                  */
 311                 new TestGroup.Simple(initBuilder,
 312                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 313                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 314                                              EnumSet.of(MethodData.Access.PUBLIC),
 315                                              EnumSet.of(MethodData.Context.ABSTRACT),
 316                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 317                         Template.MethodrefEqualsExpected,
 318                         Template.ReabstractExpectedClass,
 319                         Template.CallsiteUnrelatedToMethodref,
 320                         Template.MethodrefSelectionResolvedIsClass),
 321                 /* Group 83: callsite unrelated to methodref, methodref != expected,
 322                  * expected is class, expected and callsite not in the same package
 323                  */
 324                 new TestGroup.Simple(initBuilder,
 325                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 326                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 327                                              EnumSet.of(MethodData.Access.PUBLIC),
 328                                              EnumSet.of(MethodData.Context.ABSTRACT),
 329                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 330                         Template.MethodrefNotEqualsExpectedClass,
 331                         Template.ReabstractExpectedClass,
 332                         Template.CallsiteUnrelatedToMethodref,
 333                         Template.MethodrefSelectionResolvedIsClass),
 334                 /* Group 84: callsite unrelated to methodref, methodref != expected,
 335                  * expected is interface, expected and callsite not in the same package
 336                  */
 337                 new TestGroup.Simple(initBuilder,
 338                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 339                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 340                                              EnumSet.of(MethodData.Access.PUBLIC),
 341                                              EnumSet.of(MethodData.Context.ABSTRACT),
 342                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 343                         Template.MethodrefNotEqualsExpectedIface,
 344                         Template.ReabstractExpectedIface,
 345                         Template.CallsiteUnrelatedToMethodref,
 346                         Template.MethodrefSelectionResolvedIsIface),
 347 
 348                 /* Reabstraction during selection */
 349                 /* Group 85: callsite = methodref = expected */
 350                 new TestGroup.Simple(initBuilder,
 351                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 352                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 353                                              EnumSet.of(MethodData.Access.PROTECTED,
 354                                                         MethodData.Access.PACKAGE,
 355                                                         MethodData.Access.PUBLIC),
 356                                              EnumSet.of(MethodData.Context.INSTANCE),
 357                                              EnumSet.of(ClassData.Package.SAME)),
 358                         Template.MethodrefEqualsExpected,
 359                         Template.CallsiteEqualsMethodref,
 360                         Template.ReabstractMethodrefResolvedClass),
 361                 /* Group 86: callsite = methodref, methodref != expected,
 362                  * expected is class, expected and callsite in the same package
 363                  */
 364                 new TestGroup.Simple(initBuilder,
 365                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 366                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 367                                              EnumSet.of(MethodData.Access.PUBLIC,
 368                                                         MethodData.Access.PACKAGE,
 369                                                         MethodData.Access.PROTECTED),
 370                                              EnumSet.of(MethodData.Context.INSTANCE),
 371                                              EnumSet.of(ClassData.Package.SAME)),
 372                         Template.MethodrefNotEqualsExpectedClass,
 373                         Template.CallsiteEqualsMethodref,
 374                         Template.ReabstractMethodrefResolvedClass),
 375                 /* Group 87: callsite = methodref, methodref != expected,
 376                  * expected is interface, expected and callsite in the same package
 377                  */
 378                 new TestGroup.Simple(initBuilder,
 379                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 380                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 381                                              EnumSet.of(MethodData.Access.PUBLIC),
 382                                              EnumSet.of(MethodData.Context.INSTANCE),
 383                                              EnumSet.of(ClassData.Package.SAME)),
 384                         Template.MethodrefNotEqualsExpectedIface,
 385                         Template.CallsiteEqualsMethodref,
 386                         Template.ReabstractMethodrefResolvedIface),
 387                 /* Group 88: callsite :> methodref, methodref = expected,
 388                  * expected is class, expected and callsite in the same package
 389                  */
 390                 new TestGroup.Simple(initBuilder,
 391                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 392                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 393                                              EnumSet.of(MethodData.Access.PUBLIC,
 394                                                         MethodData.Access.PACKAGE,
 395                                                         MethodData.Access.PROTECTED),
 396                                              EnumSet.of(MethodData.Context.INSTANCE),
 397                                              EnumSet.of(ClassData.Package.SAME)),
 398                         Template.MethodrefEqualsExpected,
 399                         Template.CallsiteSubclassMethodref,
 400                         Template.ReabstractMethodrefResolvedClass),
 401                 /* Group 89: callsite :> methodref, methodref != expected,
 402                  * expected is class, expected and callsite in the same package
 403                  */
 404                 new TestGroup.Simple(initBuilder,
 405                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 406                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 407                                              EnumSet.of(MethodData.Access.PUBLIC,
 408                                                         MethodData.Access.PACKAGE,
 409                                                         MethodData.Access.PROTECTED),
 410                                              EnumSet.of(MethodData.Context.INSTANCE),
 411                                              EnumSet.of(ClassData.Package.SAME)),
 412                         Template.MethodrefNotEqualsExpectedClass,
 413                         Template.CallsiteSubclassMethodref,
 414                         Template.ReabstractMethodrefResolvedClass),
 415                 /* Group 90: callsite :> methodref, methodref != expected,
 416                  * expected is interface, expected and callsite in the same package
 417                  */
 418                 new TestGroup.Simple(initBuilder,
 419                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 420                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 421                                              EnumSet.of(MethodData.Access.PUBLIC),
 422                                              EnumSet.of(MethodData.Context.INSTANCE),
 423                                              EnumSet.of(ClassData.Package.SAME)),
 424                         Template.MethodrefNotEqualsExpectedIface,
 425                         Template.CallsiteSubclassMethodref,
 426                         Template.ReabstractMethodrefResolvedIface),
 427                 /* Group 91: callsite unrelated to methodref, methodref = expected,
 428                  * expected is class, expected and callsite in the same package
 429                  */
 430                 new TestGroup.Simple(initBuilder,
 431                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 432                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 433                                              EnumSet.of(MethodData.Access.PUBLIC,
 434                                                         MethodData.Access.PACKAGE),
 435                                              EnumSet.of(MethodData.Context.INSTANCE),
 436                                              EnumSet.of(ClassData.Package.SAME)),
 437                         Template.MethodrefEqualsExpected,
 438                         Template.CallsiteUnrelatedToMethodref,
 439                         Template.ReabstractMethodrefResolvedClass),
 440                 /* Group 92: callsite unrelated to methodref, methodref != expected,
 441                  * expected is class, expected and callsite in the same package
 442                  */
 443                 new TestGroup.Simple(initBuilder,
 444                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 445                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 446                                              EnumSet.of(MethodData.Access.PUBLIC,
 447                                                         MethodData.Access.PACKAGE),
 448                                              EnumSet.of(MethodData.Context.INSTANCE),
 449                                              EnumSet.of(ClassData.Package.SAME)),
 450                         Template.MethodrefNotEqualsExpectedClass,
 451                         Template.CallsiteUnrelatedToMethodref,
 452                         Template.ReabstractMethodrefResolvedClass),
 453                 /* Group 93: callsite unrelated to methodref, methodref != expected,
 454                  * expected is interface, expected and callsite in the same package
 455                  */
 456                 new TestGroup.Simple(initBuilder,
 457                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 458                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 459                                              EnumSet.of(MethodData.Access.PUBLIC),
 460                                              EnumSet.of(MethodData.Context.INSTANCE),
 461                                              EnumSet.of(ClassData.Package.SAME)),
 462                         Template.MethodrefNotEqualsExpectedIface,
 463                         Template.CallsiteUnrelatedToMethodref,
 464                         Template.ReabstractMethodrefResolvedIface),
 465                 /* Group 94: callsite = methodref, methodref != expected,
 466                  * expected is class, expected and callsite not in the same package
 467                  */
 468                 new TestGroup.Simple(initBuilder,
 469                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 470                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 471                                              EnumSet.of(MethodData.Access.PUBLIC),
 472                                              EnumSet.of(MethodData.Context.INSTANCE),
 473                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 474                         Template.MethodrefNotEqualsExpectedClass,
 475                         Template.CallsiteEqualsMethodref,
 476                         Template.ReabstractMethodrefResolvedClass),
 477                 /* Group 95: callsite = methodref, methodref != expected,
 478                  * expected is interface, expected and callsite not in the same package
 479                  */
 480                 new TestGroup.Simple(initBuilder,
 481                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 482                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 483                                              EnumSet.of(MethodData.Access.PUBLIC),
 484                                              EnumSet.of(MethodData.Context.INSTANCE),
 485                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 486                         Template.MethodrefNotEqualsExpectedIface,
 487                         Template.CallsiteEqualsMethodref,
 488                         Template.ReabstractMethodrefResolvedIface),
 489                 /* Group 96: callsite :> methodref, methodref = expected,
 490                  * expected is class, expected and callsite not in the same package
 491                  */
 492                 new TestGroup.Simple(initBuilder,
 493                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 494                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 495                                              EnumSet.of(MethodData.Access.PUBLIC),
 496                                              EnumSet.of(MethodData.Context.INSTANCE),
 497                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 498                         Template.MethodrefEqualsExpected,
 499                         Template.CallsiteSubclassMethodref,
 500                         Template.ReabstractMethodrefResolvedClass),
 501 
 502                 /* Group 97: callsite :> methodref, methodref != expected,
 503                  * expected is class, expected and callsite not in the same package
 504                  */
 505                 new TestGroup.Simple(initBuilder,
 506                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 507                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 508                                              EnumSet.of(MethodData.Access.PUBLIC),
 509                                              EnumSet.of(MethodData.Context.INSTANCE),
 510                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 511                         Template.MethodrefNotEqualsExpectedClass,
 512                         Template.CallsiteSubclassMethodref,
 513                         Template.ReabstractMethodrefResolvedClass),
 514                 /* Group 98: callsite :> methodref, methodref != expected,
 515                  * expected is interface, expected and callsite not in the same package
 516                  */
 517                 new TestGroup.Simple(initBuilder,
 518                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 519                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 520                                              EnumSet.of(MethodData.Access.PUBLIC),
 521                                              EnumSet.of(MethodData.Context.INSTANCE),
 522                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 523                         Template.MethodrefNotEqualsExpectedIface,
 524                         Template.CallsiteSubclassMethodref,
 525                         Template.ReabstractMethodrefResolvedIface),
 526                 /* Group 99: callsite unrelated to methodref, methodref = expected,
 527                  * expected is class, expected and callsite not in the same package
 528                  */
 529                 new TestGroup.Simple(initBuilder,
 530                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 531                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 532                                              EnumSet.of(MethodData.Access.PUBLIC),
 533                                              EnumSet.of(MethodData.Context.INSTANCE),
 534                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 535                         Template.MethodrefEqualsExpected,
 536                         Template.CallsiteUnrelatedToMethodref,
 537                         Template.ReabstractMethodrefResolvedClass),
 538                 /* Group 100: callsite unrelated to methodref, methodref != expected,
 539                  * expected is class, expected and callsite not in the same package
 540                  */
 541                 new TestGroup.Simple(initBuilder,
 542                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 543                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 544                                              EnumSet.of(MethodData.Access.PUBLIC),
 545                                              EnumSet.of(MethodData.Context.INSTANCE),
 546                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 547                         Template.MethodrefNotEqualsExpectedClass,
 548                         Template.CallsiteUnrelatedToMethodref,
 549                         Template.ReabstractMethodrefResolvedClass),
 550                 /* Group 101: callsite unrelated to methodref, methodref != expected,
 551                  * expected is interface, expected and callsite not in the same package
 552                  */
 553                 new TestGroup.Simple(initBuilder,
 554                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEVIRTUAL),
 555                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 556                                              EnumSet.of(MethodData.Access.PUBLIC),
 557                                              EnumSet.of(MethodData.Context.INSTANCE),
 558                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 559                         Template.MethodrefNotEqualsExpectedIface,
 560                         Template.CallsiteUnrelatedToMethodref,
 561                         Template.ReabstractMethodrefResolvedIface),
 562 
 563                 /* invokeinterface */
 564                 /* Group 102: callsite = methodref = expected */
 565                 new TestGroup.Simple(initBuilder,
 566                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 567                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 568                                              EnumSet.of(MethodData.Access.PUBLIC),
 569                                              EnumSet.of(MethodData.Context.ABSTRACT),
 570                                              EnumSet.of(ClassData.Package.SAME)),
 571                         Template.MethodrefEqualsExpected,
 572                         Template.ReabstractExpectedIface,
 573                         Template.CallsiteEqualsMethodref,
 574                         Template.IfaceMethodrefSelection),
 575                 /* Group 103: callsite = methodref, methodref != expected,
 576                  */
 577                 new TestGroup.Simple(initBuilder,
 578                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 579                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 580                                              EnumSet.of(MethodData.Access.PUBLIC),
 581                                              EnumSet.of(MethodData.Context.ABSTRACT),
 582                                              EnumSet.of(ClassData.Package.SAME,
 583                                                         ClassData.Package.DIFFERENT)),
 584                         Template.IfaceMethodrefNotEqualsExpected,
 585                         Template.ReabstractExpectedIface,
 586                         Template.CallsiteEqualsMethodref,
 587                         Template.IfaceMethodrefSelection),
 588                 /* Group 104: callsite :> methodref, methodref = expected,
 589                  */
 590                 new TestGroup.Simple(initBuilder,
 591                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 592                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 593                                              EnumSet.of(MethodData.Access.PUBLIC),
 594                                              EnumSet.of(MethodData.Context.ABSTRACT),
 595                                              EnumSet.of(ClassData.Package.SAME,
 596                                                         ClassData.Package.DIFFERENT)),
 597                         Template.MethodrefEqualsExpected,
 598                         Template.ReabstractExpectedIface,
 599                         Template.CallsiteSubclassMethodref,
 600                         Template.IfaceMethodrefSelection),
 601                 /* Group 105: callsite :> methodref, methodref != expected,
 602                  */
 603                 new TestGroup.Simple(initBuilder,
 604                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 605                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 606                                              EnumSet.of(MethodData.Access.PUBLIC),
 607                                              EnumSet.of(MethodData.Context.ABSTRACT),
 608                                              EnumSet.of(ClassData.Package.SAME,
 609                                                         ClassData.Package.DIFFERENT)),
 610                         Template.IfaceMethodrefNotEqualsExpected,
 611                         Template.ReabstractExpectedIface,
 612                         Template.CallsiteSubclassMethodref,
 613                         Template.IfaceMethodrefSelection),
 614                 /* Group 106: callsite unrelated to methodref, methodref = expected,
 615                  */
 616                 new TestGroup.Simple(initBuilder,
 617                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 618                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 619                                              EnumSet.of(MethodData.Access.PUBLIC),
 620                                              EnumSet.of(MethodData.Context.ABSTRACT),
 621                                              EnumSet.of(ClassData.Package.SAME,
 622                                                         ClassData.Package.DIFFERENT)),
 623                         Template.MethodrefEqualsExpected,
 624                         Template.ReabstractExpectedIface,
 625                         Template.CallsiteUnrelatedToMethodref,
 626                         Template.IfaceMethodrefSelection),
 627                 /* Group 107: callsite unrelated to methodref, methodref != expected,
 628                  */
 629                 new TestGroup.Simple(initBuilder,
 630                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 631                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 632                                              EnumSet.of(MethodData.Access.PUBLIC),
 633                                              EnumSet.of(MethodData.Context.ABSTRACT),
 634                                              EnumSet.of(ClassData.Package.SAME,
 635                                                         ClassData.Package.DIFFERENT)),
 636                         Template.IfaceMethodrefNotEqualsExpected,
 637                         Template.ReabstractExpectedIface,
 638                         Template.CallsiteUnrelatedToMethodref,
 639                         Template.IfaceMethodrefSelection),
 640 
 641                 /* Reabstraction during selection */
 642                 /* Group 108: callsite = methodref = expected */
 643                 new TestGroup.Simple(initBuilder,
 644                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 645                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 646                                              EnumSet.of(MethodData.Access.PUBLIC),
 647                                              EnumSet.of(MethodData.Context.INSTANCE),
 648                                              EnumSet.of(ClassData.Package.SAME)),
 649                         Template.MethodrefEqualsExpected,
 650                         Template.CallsiteEqualsMethodref,
 651                         Template.ReabstractIfaceMethodrefResolved),
 652                 /* Group 109: callsite = methodref, methodref != expected,
 653                  */
 654                 new TestGroup.Simple(initBuilder,
 655                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 656                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 657                                              EnumSet.of(MethodData.Access.PUBLIC),
 658                                              EnumSet.of(MethodData.Context.INSTANCE),
 659                                              EnumSet.of(ClassData.Package.SAME,
 660                                                         ClassData.Package.DIFFERENT)),
 661                         Template.IfaceMethodrefNotEqualsExpected,
 662                         Template.CallsiteEqualsMethodref,
 663                         Template.ReabstractIfaceMethodrefResolved),
 664                 /* Group 110: callsite :> methodref, methodref = expected,
 665                  */
 666                 new TestGroup.Simple(initBuilder,
 667                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 668                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 669                                              EnumSet.of(MethodData.Access.PUBLIC),
 670                                              EnumSet.of(MethodData.Context.INSTANCE),
 671                                              EnumSet.of(ClassData.Package.SAME,
 672                                                         ClassData.Package.DIFFERENT)),
 673                         Template.MethodrefEqualsExpected,
 674                         Template.CallsiteSubclassMethodref,
 675                         Template.ReabstractIfaceMethodrefResolved),
 676                 /* Group 111: callsite :> methodref, methodref != expected,
 677                  */
 678                 new TestGroup.Simple(initBuilder,
 679                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 680                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 681                                              EnumSet.of(MethodData.Access.PUBLIC),
 682                                              EnumSet.of(MethodData.Context.INSTANCE),
 683                                              EnumSet.of(ClassData.Package.SAME,
 684                                                         ClassData.Package.DIFFERENT)),
 685                         Template.IfaceMethodrefNotEqualsExpected,
 686                         Template.CallsiteSubclassMethodref,
 687                         Template.ReabstractIfaceMethodrefResolved),
 688                 /* Group 112: callsite unrelated to methodref, methodref = expected,
 689                  */
 690                 new TestGroup.Simple(initBuilder,
 691                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 692                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 693                                              EnumSet.of(MethodData.Access.PUBLIC),
 694                                              EnumSet.of(MethodData.Context.INSTANCE),
 695                                              EnumSet.of(ClassData.Package.SAME,
 696                                                         ClassData.Package.DIFFERENT)),
 697                         Template.MethodrefEqualsExpected,
 698                         Template.CallsiteUnrelatedToMethodref,
 699                         Template.ReabstractIfaceMethodrefResolved),
 700                 /* Group 113: callsite unrelated to methodref, methodref != expected,
 701                  */
 702                 new TestGroup.Simple(initBuilder,
 703                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE),
 704                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 705                                              EnumSet.of(MethodData.Access.PUBLIC),
 706                                              EnumSet.of(MethodData.Context.INSTANCE),
 707                                              EnumSet.of(ClassData.Package.SAME,
 708                                                         ClassData.Package.DIFFERENT)),
 709                         Template.IfaceMethodrefNotEqualsExpected,
 710                         Template.CallsiteUnrelatedToMethodref,
 711                         Template.ReabstractIfaceMethodrefResolved),
 712 
 713                 /* invokespecial tests */
 714                 /* Group 114: callsite = methodref = expected */
 715                 new TestGroup.Simple(initBuilder,
 716                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 717                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 718                                              EnumSet.of(MethodData.Access.PUBLIC,
 719                                                         MethodData.Access.PACKAGE,
 720                                                         MethodData.Access.PROTECTED,
 721                                                         MethodData.Access.PRIVATE),
 722                                              EnumSet.of(MethodData.Context.ABSTRACT),
 723                                              EnumSet.of(ClassData.Package.SAME)),
 724                         Template.MethodrefEqualsExpected,
 725                         Template.ReabstractExpectedClass,
 726                         Template.CallsiteEqualsMethodref,
 727                         Template.ObjectrefExactSubclassOfCallsite),
 728                 /* Group 115: callsite = methodref, methodref != expected,
 729                  * expected is class, expected and callsite in the same package
 730                  */
 731                 new TestGroup.Simple(initBuilder,
 732                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 733                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 734                                              EnumSet.of(MethodData.Access.PUBLIC,
 735                                                         MethodData.Access.PACKAGE,
 736                                                         MethodData.Access.PROTECTED),
 737                                              EnumSet.of(MethodData.Context.ABSTRACT),
 738                                              EnumSet.of(ClassData.Package.SAME)),
 739                         Template.MethodrefNotEqualsExpectedClass,
 740                         Template.ReabstractExpectedClass,
 741                         Template.CallsiteEqualsMethodref,
 742                         Template.ObjectrefExactSubclassOfCallsite),
 743                 /* Group 116: callsite = methodref, methodref != expected,
 744                  * expected is interface, expected and callsite in the same package
 745                  */
 746                 new TestGroup.Simple(initBuilder,
 747                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 748                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 749                                              EnumSet.of(MethodData.Access.PUBLIC),
 750                                              EnumSet.of(MethodData.Context.ABSTRACT),
 751                                              EnumSet.of(ClassData.Package.SAME)),
 752                         Template.MethodrefNotEqualsExpectedIface,
 753                         Template.ReabstractExpectedIface,
 754                         Template.CallsiteEqualsMethodref,
 755                         Template.ObjectrefExactSubclassOfCallsite),
 756                 /* Group 117: callsite :> methodref, methodref = expected,
 757                  * expected is class, expected and callsite in the same package
 758                  */
 759                 new TestGroup.Simple(initBuilder,
 760                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 761                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 762                                              EnumSet.of(MethodData.Access.PUBLIC,
 763                                                         MethodData.Access.PACKAGE,
 764                                                         MethodData.Access.PROTECTED),
 765                                              EnumSet.of(MethodData.Context.ABSTRACT),
 766                                              EnumSet.of(ClassData.Package.SAME)),
 767                         Template.MethodrefEqualsExpected,
 768                         Template.ReabstractExpectedClass,
 769                         Template.CallsiteSubclassMethodref,
 770                         Template.ObjectrefExactSubclassOfCallsite),
 771                 /* Group 118: callsite :> methodref, methodref != expected,
 772                  * expected is class, expected and callsite in the same package
 773                  */
 774                 new TestGroup.Simple(initBuilder,
 775                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 776                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 777                                              EnumSet.of(MethodData.Access.PUBLIC,
 778                                                         MethodData.Access.PACKAGE,
 779                                                         MethodData.Access.PROTECTED),
 780                                              EnumSet.of(MethodData.Context.ABSTRACT),
 781                                              EnumSet.of(ClassData.Package.SAME)),
 782                         Template.MethodrefNotEqualsExpectedClass,
 783                         Template.ReabstractExpectedClass,
 784                         Template.CallsiteSubclassMethodref,
 785                         Template.ObjectrefExactSubclassOfCallsite),
 786                 /* Group 119: callsite :> methodref, methodref != expected,
 787                  * expected is interface, expected and callsite in the same package
 788                  */
 789                 new TestGroup.Simple(initBuilder,
 790                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 791                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 792                                              EnumSet.of(MethodData.Access.PUBLIC),
 793                                              EnumSet.of(MethodData.Context.ABSTRACT),
 794                                              EnumSet.of(ClassData.Package.SAME)),
 795                         Template.MethodrefNotEqualsExpectedIface,
 796                         Template.ReabstractExpectedIface,
 797                         Template.CallsiteSubclassMethodref,
 798                         Template.ObjectrefExactSubclassOfCallsite),
 799                 /* Group 120: callsite = methodref, methodref != expected,
 800                  * expected is class, expected and callsite not in the same package
 801                  */
 802                 new TestGroup.Simple(initBuilder,
 803                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 804                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 805                                              EnumSet.of(MethodData.Access.PUBLIC),
 806                                              EnumSet.of(MethodData.Context.ABSTRACT),
 807                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 808                         Template.MethodrefNotEqualsExpectedClass,
 809                         Template.ReabstractExpectedClass,
 810                         Template.CallsiteEqualsMethodref,
 811                         Template.ObjectrefExactSubclassOfCallsite),
 812                 /* Group 121: callsite = methodref, methodref != expected,
 813                  * expected is interface, expected and callsite not in the same package
 814                  */
 815                 new TestGroup.Simple(initBuilder,
 816                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 817                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 818                                              EnumSet.of(MethodData.Access.PUBLIC),
 819                                              EnumSet.of(MethodData.Context.ABSTRACT),
 820                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 821                         Template.MethodrefNotEqualsExpectedIface,
 822                         Template.ReabstractExpectedIface,
 823                         Template.CallsiteEqualsMethodref,
 824                         Template.ObjectrefExactSubclassOfCallsite),
 825                 /* Group 122: callsite :> methodref, methodref = expected,
 826                  * expected is class, expected and callsite not in the same package
 827                  */
 828                 new TestGroup.Simple(initBuilder,
 829                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 830                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 831                                              EnumSet.of(MethodData.Access.PUBLIC),
 832                                              EnumSet.of(MethodData.Context.ABSTRACT),
 833                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 834                         Template.MethodrefEqualsExpected,
 835                         Template.ReabstractExpectedClass,
 836                         Template.CallsiteSubclassMethodref,
 837                         Template.ObjectrefExactSubclassOfCallsite),
 838 
 839                 /* Group 123: callsite :> methodref, methodref != expected,
 840                  * expected is class, expected and callsite not in the same package
 841                  */
 842                 new TestGroup.Simple(initBuilder,
 843                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 844                         Template.ResultCombo(EnumSet.of(Template.Kind.CLASS),
 845                                              EnumSet.of(MethodData.Access.PUBLIC),
 846                                              EnumSet.of(MethodData.Context.ABSTRACT),
 847                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 848                         Template.MethodrefNotEqualsExpectedClass,
 849                         Template.ReabstractExpectedClass,
 850                         Template.CallsiteSubclassMethodref,
 851                         Template.ObjectrefExactSubclassOfCallsite),
 852                 /* Group 124: callsite :> methodref, methodref != expected,
 853                  * expected is interface, expected and callsite not in the same package
 854                  */
 855                 new TestGroup.Simple(initBuilder,
 856                         Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKESPECIAL),
 857                         Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE),
 858                                              EnumSet.of(MethodData.Access.PUBLIC),
 859                                              EnumSet.of(MethodData.Context.ABSTRACT),
 860                                              EnumSet.of(ClassData.Package.DIFFERENT)),
 861                         Template.MethodrefNotEqualsExpectedIface,
 862                         Template.ReabstractExpectedIface,
 863                         Template.CallsiteSubclassMethodref,
 864                         Template.ObjectrefExactSubclassOfCallsite)
 865             );
 866 
 867     private AbstractMethodErrorTest() {
 868         super(testgroups);
 869     }
 870 
 871     public static void main(final String... args) {
 872         new AbstractMethodErrorTest().run();
 873     }
 874 }