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 mapOddNumberOfParameters() {
        assertThatThrownBy(() -> CollectionUtil.map("key"))
                .isInstanceOf(FlowableIllegalArgumentException.class)
                .hasMessage("The input should always be even since we expect a list of key-value pairs!");

        assertThatThrownBy(() -> CollectionUtil.map("key1", "value1", "key2"))
                .isInstanceOf(FlowableIllegalArgumentException.class)
                .hasMessage("The input should always be even since we expect a list of key-value pairs!");
    }