public static Map<String, Object> map(Object... objects) {

        if (objects.length % 2 != 0) {
            throw new FlowableIllegalArgumentException("The input should always be even since we expect a list of key-value pairs!");
        }

        Map<String, Object> map = new HashMap<>();
        for (int i = 0; i < objects.length; i += 2) {
            map.put((String) objects[i], objects[i + 1]);
        }

        return map;
    }
@Test
    void mapEvenNumberOfParameters() {
        assertThat(CollectionUtil.map("key", "value"))
                .containsExactly(entry("key", "value"));

        assertThat(CollectionUtil.map("key1", "value1", "key2", "value2"))
                .containsOnly(
                        entry("key1", "value1"),
                        entry("key2", "value2")
                );
    }