### Question:
BridgeInputBuilder { public List<OneField> makeInput(DataInput inputStream) throws Exception { if (protocolData.getOutputFormat() == OutputFormat.TEXT) { return Collections.singletonList(new OneField(DataType.BYTEA.getOID(), inputStream)); } GPDBWritable gpdbWritable = new GPDBWritable(); gpdbWritable.readFields(inputStream); if (gpdbWritable.isEmpty()) { LOG.debug("Reached end of stream"); return null; } GPDBWritableMapper mapper = new GPDBWritableMapper(gpdbWritable); int[] colTypes = gpdbWritable.getColType(); List<OneField> record = new LinkedList<>(); for (int i = 0; i < colTypes.length; i++) { mapper.setDataType(colTypes[i]); record.add(new OneField(colTypes[i], mapper.getData(i))); } return record; } BridgeInputBuilder(RequestContext protocolData); List<OneField> makeInput(DataInput inputStream);  }### Answer:
@Test public void makeInput() throws Exception { byte[] data = new byte[]{ (int) 'a', (int) 'b', (int) 'c', (int) 'd', (int) '\n', (int) 'n', (int) 'o', (int) '\n'}; prepareInput(data); List<OneField> record = inputBuilder.makeInput(inputStream); verifyRecord(record, Arrays.copyOfRange(data, 0, 8)); }
@Test public void makeInputBigArray() throws Exception { byte[] bigArray = new byte[2000]; for (int i = 0; i < 1999; ++i) { bigArray[i] = (byte) (i % 10 + 30); } bigArray[1999] = (byte) '\n'; prepareInput(bigArray); List<OneField> record = inputBuilder.makeInput(inputStream); verifyRecord(record, bigArray); }
@Test public void makeInputBigArrayNoNewLine() throws Exception { byte[] bigArray = new byte[2000]; for (int i = 0; i < 2000; ++i) { bigArray[i] = (byte) (i % 10 + 60); } prepareInput(bigArray); List<OneField> record = inputBuilder.makeInput(inputStream); verifyRecord(record, bigArray); }
@Test public void makeInputEmptyStream() throws Exception { byte[] empty = new byte[0]; prepareInput(empty); List<OneField> record = inputBuilder.makeInput(inputStream); verifyRecord(record, empty); }