void () { /* { "intField" : 43 "obj": { "name" : "testName", "versions" : ["1", "2"] } } */ EventLogGroup group = new EventLogGroup("newGroup", 1); StringEventField nameField = EventFields.StringValidatedByEnum("name", "os"); StringListEventField versionsField = EventFields.StringListValidatedByCustomRule("versions", CustomValidationRule.class); IntEventField intEventField = EventFields.Int("intField"); EventId2<Integer, ObjectEventData> event = group.registerEvent("testEvent", intEventField, new ObjectEventField("obj", nameField, versionsField)); int intValue = 43; String testName = "testName"; List<String> versionsValue = Arrays.asList("1", "2"); List<LogEvent> events = FUCollectorTestCase.INSTANCE.collectLogEvents(getTestRootDisposable(), () -> { event.log(43, new ObjectEventData(nameField.with("testName"), versionsField.with(Arrays.asList("1", "2")))); return Unit.INSTANCE; }); UsefulTestCase.assertSize(1, events); Map<String, Object> eventData = events.get(0).getEvent().getData(); TestCase.assertEquals(intValue, eventData.get("intField")); Map<?, ?> objEventData = (Map<?, ?>)eventData.get("obj"); TestCase.assertEquals(testName, objEventData.get("name")); List<?> versions = (List<?>)objEventData.get("versions"); TestCase.assertEquals(versionsValue, versions); }