### Question:
IospHelper { public static Object makePrimitiveArray(int size, DataType dataType) { Object arr = null; if ((dataType.getPrimitiveClassType() == byte.class) || (dataType == DataType.CHAR) || (dataType == DataType.OPAQUE) || (dataType == DataType.STRUCTURE)) { arr = new byte[size]; } else if (dataType.getPrimitiveClassType() == short.class) { arr = new short[size]; } else if (dataType.getPrimitiveClassType() == int.class) { arr = new int[size]; } else if (dataType.getPrimitiveClassType() == long.class) { arr = new long[size]; } else if (dataType == DataType.FLOAT) { arr = new float[size]; } else if (dataType == DataType.DOUBLE) { arr = new double[size]; } else if (dataType == DataType.STRING) { arr = new String[size]; } return arr; }  static Object readDataFill(RandomAccessFile raf, Layout index, DataType dataType, Object fillValue,
      int byteOrder); static Object readDataFill(RandomAccessFile raf, Layout index, DataType dataType, Object fillValue,
      int byteOrder, boolean convertChar); static Object readData(RandomAccessFile raf, Layout layout, DataType dataType, Object arr, int byteOrder,
      boolean convertChar); static Object readDataFill(PositioningDataInputStream is, Layout index, DataType dataType, Object fillValue); static Object readData(PositioningDataInputStream raf, Layout index, DataType dataType, Object arr); static Object readDataFill(LayoutBB layout, DataType dataType, Object fillValue); static Object readData(LayoutBB layout, DataType dataType, Object arr); static long copyToOutputStream(Array data, OutputStream out); static Object makePrimitiveArray(int size, DataType dataType); static Object makePrimitiveArray(int size, DataType dataType, Object fillValue); static char[] convertByteToCharUTF(byte[] byteArray); static byte[] convertCharToByteUTF(char[] from); static char[] convertByteToChar(byte[] byteArray); static byte[] convertCharToByte(char[] from); static ucar.ma2.Array readSection(ParsedSectionSpec cer);  }### Answer:
@Test public void testMakePrimitiveArray() throws InvalidRangeException { Object sresult = IospHelper.makePrimitiveArray(10, DataType.STRING); String[] stringFill = (String[]) sresult; for (String s : stringFill) { assertThat(s).isEqualTo(null); } }
@Test public void testMakePrimitiveArrayWithFill() throws InvalidRangeException { assertThat(IospHelper.makePrimitiveArray(11, DataType.OPAQUE, 22l)).isEqualTo(new byte[11]); Object sresult = IospHelper.makePrimitiveArray(10, DataType.STRING, "fill"); String[] stringFill = (String[]) sresult; for (String s : stringFill) { assertThat(s).isEqualTo("fill"); } Object stresult = IospHelper.makePrimitiveArray(10, DataType.STRUCTURE, new byte[] {1, 2, 3}); byte[] fill = (byte[]) stresult; for (int i = 0; i < 10; i++) { assertThat(fill[i]).isEqualTo(i < 3 ? i + 1 : 0); } }