Map<String, String> removeSelfReferences(final Map<String, String> vars) {
        final Map<String, String> resolvedVars = new HashMap<>();

        vars.forEach((key, value) -> {
            if (!isVariableSelfReferencing(vars, key)) {
                resolvedVars.put(key, value);
            }
        });

        return resolvedVars;
    }
@Test
    public void testRemoveSelfReferences() {
        // Given
        Map<String, String> input = new HashMap<>();
        input.put("Deflate_OLD_FIND_LIBRARY_PREFIXES", "${CMAKE_FIND_LIBRARY_PREFIXES}");
        input.put("Deflate_INCLUDE_DIRS", "${Deflate_INCLUDE_DIR}");
        input.put("Deflate_LIBRARIES", "${Deflate_LIBRARY}");
        input.put("Deflate_MINOR_VERSION", "${Deflate_VERSION_MINOR}");
        input.put("Deflate_VERSION_STRING", "${Deflate_MAJOR_VERSION}.${Deflate_MINOR_VERSION}");
        input.put("CMAKE_FIND_LIBRARY_PREFIXES", "${Deflate_OLD_FIND_LIBRARY_PREFIXES}");
        input.put("Deflate_MAJOR_VERSION", "${Deflate_VERSION_MAJOR}");

        Map<String, String> expectedOutput = new HashMap<>();
        expectedOutput.put("Deflate_INCLUDE_DIRS", "${Deflate_INCLUDE_DIR}");
        expectedOutput.put("Deflate_LIBRARIES", "${Deflate_LIBRARY}");
        expectedOutput.put("Deflate_MINOR_VERSION", "${Deflate_VERSION_MINOR}");
        expectedOutput.put("Deflate_VERSION_STRING", "${Deflate_MAJOR_VERSION}.${Deflate_MINOR_VERSION}");
        expectedOutput.put("Deflate_MAJOR_VERSION", "${Deflate_VERSION_MAJOR}");

        // When
        Map<String, String> output = analyzer.removeSelfReferences(input);

        // Then
        assertEquals(expectedOutput, output);
    }