assertEquals(0, mh.invokeWithArguments(Collections.EMPTY_MAP));
assertEquals(1, mh.invokeWithArguments(Collections.singletonMap("a", "b")));
}
public void testLateBoundLengthGetter() throws Throwable {
final DynamicLinker linker = new DynamicLinkerFactory().createLinker();
final RelinkCountingCallSite callSite =
new RelinkCountingCallSite("dyn:getLength", MethodType.methodType(int.class, Object.class));
linker.link(callSite);
assertEquals(0, callSite.getRelinkCount());
MethodHandle callSiteInvoker = callSite.dynamicInvoker();
assertEquals(2, callSiteInvoker.invokeWithArguments(new int[2]));
assertEquals(1, callSite.getRelinkCount());
assertEquals(3, callSiteInvoker.invokeWithArguments(new Object[] { new Object[3] }));