@Override
    public void setAll(Properties properties) {
        @SuppressWarnings("unchecked") Enumeration<String> names =
                (Enumeration<String>) properties.propertyNames();

        while (names.hasMoreElements()) {
            String name = names.nextElement();
            Property property = Property.get(name);
            if (property == null) {
                throw new PropertyTypeException("Unknown property: " + name);
            }

            String value = properties.getProperty(name);

            if (property.isMultiValuePermitted()) {
                this.set(property, new String[]{value});
            } else {
                this.set(property, value);
            }
        }
    }
@Test
    public void testSetAll() {
        Properties props = new Properties();
        props.put(TikaCoreProperties.FORMAT.getName(), "format");
        props.put(TikaCoreProperties.SUBJECT.getName(), "keyword");

        xmpMeta.setAll(props);

        assertEquals("format", xmpMeta.get(TikaCoreProperties.FORMAT));

        String[] values = xmpMeta.getValues(TikaCoreProperties.SUBJECT);
        assertEquals(1, values.length);

        assertEquals("keyword", values[0]);
    }