public static Map<String, Object> toValueMap(ReferenceMap m, Map<String, ValueReference> parameters) {
        final ImmutableMap.Builder<String, Object> mapBuilder = ImmutableMap.builder();
        for (Map.Entry<String, Reference> entry : m.entrySet()) {
            final Object value = valueOf(entry.getValue(), parameters);
            if (value != null) {
                mapBuilder.put(entry.getKey(), value);
            }
        }
        return mapBuilder.build();
    }
@Test
    public void toValueMapWithCircularParameter() {
        final Map<String, ValueReference> parameters = Collections.singletonMap("STRING", ValueReference.createParameter("OTHER"));
        final ReferenceMap map = new ReferenceMap(Collections.singletonMap("param", ValueReference.createParameter("STRING")));

        assertThatThrownBy(() -> ReferenceMapUtils.toValueMap(map, parameters))
                .isInstanceOf(IllegalArgumentException.class)
                .hasMessage("Circular parameter STRING");
    }