我只是看着番石榴ImmutableList,我注意到这个of()方法超载了12次.
在我看来,他们所需要的只是:
static <E> ImmutableList<E> of();
static <E> ImmutableList<E> of(E element); // not even necessary
static <E> ImmutableList<E> of(E... elements);
Run Code Online (Sandbox Code Playgroud)
有这么多类似变化的原因是什么?