public static Map<String, Expression> mapFromProperties(List<Property> properties)
    {
        Map<String, Expression> outputMap = new HashMap<>();

        for (Property property : properties) {
            String key = property.getName().getValue();
            if (outputMap.containsKey(key)) {
                throw new PrestoException(SYNTAX_ERROR, format("Duplicate property found: %s=%s and %s=%s", key, outputMap.get(key), key, property.getValue()));
            }
            outputMap.put(key, property.getValue());
        }

        return ImmutableMap.copyOf(outputMap);
    }
@Test
    public void testMapFromProperties()
    {
        List<Property> propertyList = new ArrayList<>();
        propertyList.add(new Property(new Identifier("a"), new StringLiteral("apple")));
        propertyList.add(new Property(new Identifier("b"), new StringLiteral("ball")));
        Map<String, Expression> stringExpressionMap = NodeUtils.mapFromProperties(propertyList);
        assertEquals(2, stringExpressionMap.size());
        assertEquals(new StringLiteral("apple"), stringExpressionMap.get("a"));
        assertEquals(new StringLiteral("ball"), stringExpressionMap.get("b"));
    }