private @NotNull CallTarget getCallTarget(@NotNull RemoteCall call, Object[] transformedArgs) {
    Class<?> clazz = getTargetClass(call);

    int argCount = call.getArgs().length;

    List<Method> availableMethods = Arrays.stream(clazz.getMethods()).toList();
    List<Method> targetMethods = availableMethods.stream()
      .filter(m -> m.getName().equals(call.getMethodName()) && argCount == m.getParameterCount())
      .toList();

    if (targetMethods.isEmpty()) {
      throw new IllegalStateException(
        String.format("No method '%s' with parameter count %s in class %s. Available methods: %n%s",
                      call.getMethodName(), argCount, call.getClassName(),
                      availableMethods.stream().map(it -> it.toString())
                        .collect(Collectors.joining(" - " + System.lineSeparator()))
        ));
    }

    if (targetMethods.size() > 1) {
      List<@Nullable Class<?>> argumentTypes = getArgumentTypes(transformedArgs);
      // take into account argument types
      for (Method method : targetMethods) {
        if (areTypesCompatible(method.getParameterTypes(), argumentTypes)) {
          return buildCallTarget(clazz, method);
        }
      }
    }

    return buildCallTarget(clazz, targetMethods.get(0));
  }
private @NotNull CallTarget getCallTarget(@NotNull RemoteCall call, Object[] transformedArgs)