chia7712 commented on code in PR #15507:
URL: https://github.com/apache/kafka/pull/15507#discussion_r1525490485


##########
server-common/src/test/java/org/apache/kafka/server/mutable/BoundedListTest.java:
##########
@@ -165,18 +199,24 @@ public void testIterator() {
 
     @Test
     public void testIteratorIsImmutable() {
-        BoundedList<Integer> list = new BoundedList<>(3, new 
ArrayList<>(Arrays.asList(1, 2, 3)));
+        BoundedList<Integer> list = BoundedList.newArrayBacked(3);
+        list.add(1);
+        list.add(2);
+        list.add(3);
         assertThrows(UnsupportedOperationException.class,
-            () -> list.iterator().remove());
+                () -> list.iterator().remove());

Review Comment:
   ditto



##########
server-common/src/test/java/org/apache/kafka/server/mutable/BoundedListTest.java:
##########
@@ -165,18 +199,24 @@ public void testIterator() {
 
     @Test
     public void testIteratorIsImmutable() {
-        BoundedList<Integer> list = new BoundedList<>(3, new 
ArrayList<>(Arrays.asList(1, 2, 3)));
+        BoundedList<Integer> list = BoundedList.newArrayBacked(3);
+        list.add(1);
+        list.add(2);
+        list.add(3);
         assertThrows(UnsupportedOperationException.class,
-            () -> list.iterator().remove());
+                () -> list.iterator().remove());
         assertThrows(UnsupportedOperationException.class,
-            () -> list.listIterator().remove());
+                () -> list.listIterator().remove());
     }
 
     @Test
     public void testSubList() {
-        BoundedList<Integer> list = new BoundedList<>(3, new 
ArrayList<>(Arrays.asList(1, 2, 3)));
+        BoundedList<Integer> list = BoundedList.newArrayBacked(3);
+        list.add(1);
+        list.add(2);
+        list.add(3);
         assertEquals(Arrays.asList(2), list.subList(1, 2));
         assertThrows(UnsupportedOperationException.class,
-            () -> list.subList(1, 2).remove(2));
+                () -> list.subList(1, 2).remove(2));

Review Comment:
   Could you please remove the indentation?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to