You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test doesn't trigger resizing due to less items added than needed (DEFAULT_CAPACITY for java.utilArrayList is 16).
possible fix:
@Test
@Order(12)
void addShouldResizeDefaultCapacityWhenArrayIsFull() {
arrayList = new ArrayList<>();
int defaultCapacity = getTestArray().length;
for (int i = 0; i < defaultCapacity + 1; i++) {
arrayList.add(i); // Add enough elements to exceed the default capacity
}
assertThat(getTestArray().length).isGreaterThan(defaultCapacity); // Ensure the array has grown
assertThat(getTestSize()).isEqualTo(defaultCapacity + 1); // Ensure the size reflects all added elements
}
The text was updated successfully, but these errors were encountered:
test doesn't trigger resizing due to less items added than needed (DEFAULT_CAPACITY for java.utilArrayList is 16).
possible fix:
The text was updated successfully, but these errors were encountered: