@Override
    public Collection<Event> filter(Collection<Event> events, final FilterMatchListener filterMatchListener) {
        for (Event e : events) {
            if (overwrite || e.getField(target) == null) {
                e.setField(target, UUID.randomUUID().toString());
            }
            filterMatchListener.filterMatched(e);
        }
        return events;
    }
@Test
    public void testUuidWithoutOverwrite() {
        String targetField = "target_field";
        String originalValue = "originalValue";
        Map<String, Object> rawConfig = new HashMap<>();
        rawConfig.put(Uuid.TARGET_CONFIG.name(), targetField);
        Configuration config = new ConfigurationImpl(rawConfig);
        Uuid uuid = new Uuid(ID, config, new ContextImpl(null, null));
        PluginUtil.validateConfig(uuid, config);

        org.logstash.Event e = new org.logstash.Event();
        e.setField(targetField, originalValue);
        Collection<Event> filteredEvents = uuid.filter(Collections.singletonList(e), NO_OP_MATCH_LISTENER);

        Assert.assertEquals(1, filteredEvents.size());
        Event finalEvent = filteredEvents.stream().findFirst().orElse(null);
        Assert.assertNotNull(finalEvent);
        Assert.assertEquals(originalValue, finalEvent.getField(targetField));
    }