### Question:
SensorisProtobufSplittedUDFExample implements SplittedUDF { @Override public byte[] merge(Map<String, Object> keys, Iterator<byte[]> files) { return combineDataMessages(files); }  @Override Map<Map<String, Object>, byte[]> getSplittedKeys(
      Map<MetadataName, String> map, byte[] bytes); @Override byte[] aggregate(Map<String, Object> keys, Iterator<byte[]> messages); @Override byte[] merge(Map<String, Object> keys, Iterator<byte[]> files); static final double SENSORIS_GEOGRAPHIC_SURFACE_RESOLUTION; static final double SENSORIS_GEOGRAPHIC_ALTITUDE_RESOLUTION; }### Answer:
@Test public void testMerge() throws InvalidProtocolBufferException { List<byte[]> list = Arrays.asList(b1, b2); Iterator<byte[]> it = list.iterator(); List<byte[]> list2 = Arrays.asList(b3, b4); Iterator<byte[]> it2 = list2.iterator(); byte[] a1 = example.aggregate(new HashMap<>(), it); byte[] a2 = example.aggregate(new HashMap<>(), it2); Iterator<byte[]> mergedIt = Arrays.asList(a1, a2).iterator(); byte[] mergedByteArray = example.merge(new HashMap<>(), mergedIt); List<DataMessage> mergedMessageList = DataMessages.parseFrom(mergedByteArray).getDataMessageList(); assertEquals(m1, mergedMessageList.get(0)); assertEquals(m2, mergedMessageList.get(1)); assertEquals(m3, mergedMessageList.get(2)); assertEquals(m4, mergedMessageList.get(3)); }