    @Test
    public void testValidateMultiRefsEvent() {


        Mockito.when(eventsProvider.getCurrentEventsVersion(tenantId))
                .thenReturn(version, version);
        Mockito.when(eventsProvider.getEvents(Mockito.any(EventsProcessorId.class)))
                .thenReturn(Arrays.asList(event));

        ObjectNode instance = mapper.createObjectNode();
        instance.put("value", "value");
        instance.put("ref_field", mapper.convertValue(new ObjectId("Bar", new Id(2)).toStringForm(), JsonNode.class));
        instance.put("refs_field", mapper.convertValue(
                Arrays.asList(new ObjectId("Baz", new Id(3)).toStringForm(),
                        new ObjectId("Gaga", new Id(7)).toStringForm()), JsonNode.class));
        instance.put("all_field", mapper.convertValue(
                Arrays.asList(new ObjectId("Goo", new Id(4)).toStringForm(),
                        new ObjectId("Gaga", new Id(7)).toStringForm()), JsonNode.class));

        ObjectNode event2 = mapper.createObjectNode();
        jec.setEventId(event2, 1);
        jec.setInstanceNode(event2, "Foo", instance);

        tenantEventsProvider.loadModel(tenantId);
        VersionedEventsModel versionedEventsModel = tenantEventsProvider.getVersionedEventsModel(tenantId);
        Validated validateEvent = eventValidator.validateEvent(versionedEventsModel, event2);
        Assert.assertTrue(validateEvent.isValid());

    }