private <T, R> R testMax(T[] values, Aggregation<String, T, R> aggregation) throws Exception {

    String mapName = randomMapName();
    IMap<String, T> map = client.getMap(mapName);

    for (int i = 0; i < values.length; i++) {
      map.put("key-" + i, values[i]);
    }

    Supplier<String, T, T> supplier = Supplier.all();
    return map.aggregate(supplier, aggregation);
  }