boolean (@NotNull SmartList<?> that) { int size = mySize; if (size != that.mySize) { return false; } switch (size) { case 0: return true; case 1: return Objects.equals(myElem, that.myElem); default: return Arrays.equals(asArray(), that.asArray()); } }