The constructor of Array, ArraySet and ArrayMap uses instanceof for doing different logics according to different input which implements Iterable. This can be avoided by creating 2 new constructors taking Collection and other class and put the logic there.
The constructor of
Array,ArraySetandArrayMapusesinstanceoffor doing different logics according to different input which implementsIterable. This can be avoided by creating 2 new constructors takingCollectionand other class and put the logic there.