def METHOD_NAME(self, arguments, patch_locations, expected):
    merger = AvgMerger(**arguments)
    for pl in patch_locations:
        merger.aggregate(pl[0], pl[1])
    output = merger.finalize()
    if "value_dtype" in arguments:
        self.assertTrue(merger.get_values().dtype, arguments["value_dtype"])
    if "count_dtype" in arguments:
        self.assertTrue(merger.get_counts().dtype, arguments["count_dtype"])
    # check for multiple call of finalize
    self.assertIs(output, merger.finalize())
    # check if the result is matching the expectation
    assert_allclose(output, expected)