### Question:
BlockUtil { static int calculateNewArraySize(int currentSize) { long newSize = (long) currentSize + (currentSize >> 1); if (newSize < DEFAULT_CAPACITY) { newSize = DEFAULT_CAPACITY; } else if (newSize > MAX_ARRAY_SIZE) { newSize = MAX_ARRAY_SIZE; if (newSize == currentSize) { throw new IllegalArgumentException(format("Cannot grow array beyond '%s'", MAX_ARRAY_SIZE)); } } return (int) newSize; } private  BlockUtil();   }### Answer:
@Test public void testCalculateNewArraySize() { assertEquals(BlockUtil.calculateNewArraySize(200), 300); assertEquals(BlockUtil.calculateNewArraySize(Integer.MAX_VALUE), MAX_ARRAY_SIZE); try { BlockUtil.calculateNewArraySize(MAX_ARRAY_SIZE); } catch (IllegalArgumentException e) { assertEquals(e.getMessage(), format("Cannot grow array beyond '%s'", MAX_ARRAY_SIZE)); } }