static Map<String, Object> addType(Map<String, Object> event, String type) {
        event.putIfAbsent("type", type);
        return event;
    }
@Test
    public void testAddType() {
        // add tag to empty event
        Map<String, Object> e = new HashMap<>();
        String testType = "test_type";
        Map<String, Object> e2 = CommonActions.addType(e, testType);
        Assert.assertEquals(testType, e2.get("type"));

        // add type to already-typed event
        e = new HashMap<>();
        String existingType = "existing_type";
        e.put("type", existingType);
        e2 = CommonActions.addType(e, testType);
        Assert.assertEquals(existingType, e2.get("type"));
    }