### Question:
JavaNativeUtil { public static Method getMatchMethod(Method[] methods, Object[] args) { return getMatchMethod(methods, getArgTypes(args)); } private  JavaNativeUtil(); static int addStaticMethods(Engine engine, Class<?> type); static int addStaticMethods(Engine engine, Class<?> type, boolean skipConflict); static int addStaticMethods(GlobalManager manager,
                                       NativeFactory nativeFactory,
                                       Class<?> type); static int addStaticMethods(
            GlobalManager manager,
            NativeFactory nativeFactory,
            Class<?> type,
            boolean skipConflict
    ); static int addConstFields(Engine engine, Class<?> type); static int addConstFields(Engine engine, Class<?> type, boolean skipConflict); static int addConstFields(
            GlobalManager manager,
            NativeFactory nativeFactory,
            Class<?> type
    ); static int addConstFields(
            GlobalManager manager,
            NativeFactory nativeFactory,
            Class<?> type,
            boolean skipConflict
    ); static Class<?>[] getArgTypes(Object[] args); static Method getMatchMethod(Method[] methods, Object[] args); static Method getMatchMethod(Method[] methods, Object[] args, boolean mix); static Method getMatchMethod(Method[] methods, Class<?>[] argTypes); @SuppressWarnings({ "squid:S3776" // Cognitive Complexity of methods should not be too high }) static Method getMatchMethod(Method[] methods, Class<?>[] argTypes, boolean mix); static Constructor getMatchConstructor(Constructor[] constructors, Object[] args); static Constructor getMatchConstructor(Constructor[] constructors, Class<?>[] argTypes); static Object invokeMethod(
            final Method method,
            final Object[] args
    ); static Object[] prepareArgs(final int acceptArgsCount, final Object[] args, final int from); static Object invokeMethod(
            final Method method,
            final Object me,
            final Object[] args
    ); static Object invokeConstructor(final Constructor constructor, final Object[] args);  }### Answer:
@Test void test() { assertEquals(methodPool.get("fooEmpty"), matchFoo()); assertEquals(methodPool.get("fooString"), matchFoo(String.class)); assertEquals(methodPool.get("fooObject"), matchFoo(StringBuilder.class)); assertEquals(methodPool.get("fooInt"), matchFoo(Integer.class)); assertEquals(methodPool.get("fooList"), matchFoo(List.class)); assertEquals(methodPool.get("fooArrayList"), matchFoo(ArrayList.class)); assertEquals(methodPool.get("fooList"), matchFoo(LinkedList.class)); assertEquals(methodPool.get("fooArrayListObject"), matchFoo(ArrayList.class, Integer.class)); assertEquals(methodPool.get("fooListObject"), matchFoo(List.class, Integer.class)); assertEquals(methodPool.get("fooObjectListList"), matchFoo(ArrayList.class, ArrayList.class, ArrayList.class)); assertEquals(methodPool.get("fooArrayListObject"), matchFoo(ArrayList.class, null)); assertEquals(methodPool.get("fooArrayListObjectObject"), matchFoo(ArrayList.class, null, null)); assertEquals(methodPool.get("fooArrayListObjectObject"), matchFoo(ArrayList.class, null, ArrayList.class)); assertNull(getMatchMethod( new Method[]{ methodPool.get("fooEmpty"), methodPool.get("fooObject"), methodPool.get("fooString") }, String.class, null) ); }