class DefaultSlingSimulator implements SlingSimulatorBackend, SlingSimulator {

    static void loadJcrProperties(final @NotNull Map<String, Object> configMap, final @NotNull Node configNode)
            throws RepositoryException {
        final PropertyIterator pi = configNode.getProperties();
        while (pi.hasNext()) {
            final Property p = pi.nextProperty();
            final String name = p.getName();

            // ignore jcr: and similar properties
            if (name.contains(":")) {
                continue;
            }
            if (p.getDefinition().isMultiple()) {
                Object[] data = null;
                final Value[] values = p.getValues();
                int i = 0;
                for (Value v : values) {
                    Object o = convertJcrValue(v);
                    if (o != null) {
                        if (i == 0) {
                            data = (Object[]) Array.newInstance(o.getClass(), values.length);
                        }
                        data[i++] = o;
                    }
                }
                // create empty array in case no value is specified
                if (data == null) {
                    data = new String[0];
                }
                configMap.put(name, data);

            } else {
                final Object o = convertJcrValue(p.getValue());
                if (o != null) {
                    configMap.put(name, o);
                }
            }
        }
    }

}