UntypedValuesMergeFunction implements MergeFunction<MRecord, MRecord> { UntypedValues mapWithoutState(UntypedValues currentValues, MRecord newValues) { UntypedValues state; if (currentValues == null) { state = (UntypedValues) newValues; } else { state = currentValues.merge((UntypedValues) newValues); } return state; }  @Override MRecord merge(MRecord currentValue);  }
@Test public void mapWithoutState() { UntypedValues result = mergeFunction.mapWithoutState(record1, record2); assertEquals(123L, (long)result.getValue("test1").getAsLong()); assertEquals("string", result.getValue("test2").getAsString()); result = clone.mapWithoutState(record1, record2); assertEquals(123L, (long)result.getValue("test1").getAsLong()); assertEquals("string", result.getValue("test2").getAsString()); }