public Directory configure(LinkedHashMap<String, String> config) {
        for (Map.Entry<String, String> kv : config.entrySet()) {
            String value = kv.getValue().trim();
            if (kv.getKey().startsWith("preload."))
                try {
                    String pattern = kv.getKey().substring("preload.".length());
                    mmapPreloads.put(pattern, Integer.parseInt(value));
                } catch (NumberFormatException ex) {
                    throw new IllegalArgumentException("DataAccess " + kv.getKey() + " has an incorrect preload value: " + value);
                }
            else {
                String pattern = kv.getKey();
                defaultTypes.put(pattern, DAType.fromString(value));
            }
        }
        return this;
    }
@Test
    public void testConfigure() {
        GHDirectory dir = new GHDirectory("", DAType.RAM_STORE);
        LinkedHashMap<String, String> map = new LinkedHashMap<>();
        map.put("nodes", "MMAP");
        dir.configure(map);
        assertEquals(DAType.MMAP, dir.getDefaultType("nodes", true));

        // first rule wins
        map.put("preload.nodes", "10");
        map.put("preload.nodes.*", "100");
        dir.configure(map);
        assertEquals(10, dir.getPreload("nodes"));
    }