### Question:
IntegerMaxKudaf extends KsqlAggregateFunction<Integer, Integer> { @Override public Integer aggregate(Integer currentVal, Integer currentAggVal) { if (currentVal == null) { return currentAggVal; } return Math.max(currentVal, currentAggVal); } IntegerMaxKudaf(int argIndexInValue); @Override Integer aggregate(Integer currentVal, Integer currentAggVal); @Override Merger<String, Integer> getMerger(); @Override KsqlAggregateFunction<Integer, Integer> getInstance(Map<String, Integer> expressionNames,
                                                           List<Expression> functionArguments);  }### Answer:
@Test public void shouldFindCorrectMax() { IntegerMaxKudaf integerMaxKudaf = getIntegerMaxKudaf(); int[] values = new int[]{3, 5, 8, 2, 3, 4, 5}; int currentMax = Integer.MIN_VALUE; for (int i: values) { currentMax = integerMaxKudaf.aggregate(i, currentMax); } assertThat(8, equalTo(currentMax)); }