MethodParams { public int size() { return params.size(); } private  MethodParams(@Nullable ArgumentFilter filter, Class<?>... types); private  MethodParams(@Nullable ArgumentFilter filter, ImmutableList<Class<?>> params); static MethodParams of(SubscriberMethod method); static MethodParams of(Method method); int size(); Optional<ArgumentFilter> filter(); Class<?> type(int index); boolean is(TypeMatcher type); boolean are(Class<?>... types); boolean match(TypeMatcher... criteria); boolean match(List<TypeMatcher> criteria); static boolean firstIsCommand(Method method); @Override boolean equals(Object o); @Override int hashCode(); @SuppressWarnings("DuplicateStringLiteralInspection") // others also have the `filter` field. @Override String toString();  }
@Test @DisplayName("obtain the number of parameters") void size() { assertThat(MethodParams.of(singleParamCommand()).size()) .isEqualTo(1); assertThat(MethodParams.of(twoParamCommandAndCtx()).size()) .isEqualTo(2); assertThat(MethodParams.of(fiveParamMethodStringAnyEmptyInt32UserId()).size()) .isEqualTo(5); }