public class TestElementGetter extends TestCase {
public void testEarlyBoundPrimitiveArrayElementGetter() throws Throwable {
final RelinkCountingCallSite cs =
new RelinkCountingCallSite("dyn:getElem", MethodType.methodType(Object.class, int[].class, int.class));
new DynamicLinkerFactory().createLinker().link(cs);
final MethodHandle invoker = cs.dynamicInvoker();
final int[] x = new int[] { 3, 2, 1 };
assertEquals(3, invoker.invokeWithArguments(x, 0));
assertEquals(2, invoker.invokeWithArguments(x, 1));
assertEquals(1, invoker.invokeWithArguments(x, 2));