### Question:
DataChunk { public static List<DataChunk> splitData(InputStream inputStream) throws IOException { ArrayList<DataChunk> chunksToSend = new ArrayList(); byte[] data = new byte[CHUNK_SIZE]; int totalFileSize = 0; int quantityToSend; int roomLeft = CHUNK_SIZE; int offset = 0; int chunksRead = 0; while ((quantityToSend = inputStream.read(data, offset, roomLeft)) != -1) { offset += quantityToSend; roomLeft -= quantityToSend; if (roomLeft == 0) { chunksToSend.add(new DataChunk(data, CHUNK_SIZE, chunksRead * CHUNK_SIZE)); chunksRead++; roomLeft = CHUNK_SIZE; offset = 0; totalFileSize += CHUNK_SIZE; data = new byte[CHUNK_SIZE]; } } if (offset != 0) { chunksToSend.add(new DataChunk(data, offset, chunksRead * CHUNK_SIZE)); totalFileSize += offset; chunksRead++; } return chunksToSend; } DataChunk(byte[] data, int size, int rangeStart); int getSize(); byte[] getData(); int getStart(); int getEnd(); static List<DataChunk> splitData(InputStream inputStream);  }### Answer:
@Test public void testSplitDataEmpty() throws IOException { inputStream = new ByteArrayInputStream(new byte[0]); List<DataChunk> l = DataChunk.splitData(inputStream); assertThat(l).hasSize(0); }