@Test
public void customizableConflictResolution() throws Exception {

    final ConcurrentHashMultimap.ConflictResolver<TestEntity> onlyReplaceV1 =
            (old, replacement) -> old.value.contains("v1");
    ConcurrentHashMultimap<String, TestEntity> multiMapThatOnlyReplacesV1 =
            new ConcurrentHashMultimap<>(TestEntity.idExtractor, onlyReplaceV1);
    multiMapThatOnlyReplacesV1.put("first", new TestEntity("1", "v1"));
    assertThat(multiMapThatOnlyReplacesV1.put("first", new TestEntity("1", "v2"))).isTrue();
    assertThat(multiMapThatOnlyReplacesV1.put("first", new TestEntity("1", "v1"))).isFalse();
}