private Map<String, Object> getProperties(final Map<String, Object> props) {
        Map<String, Object> result = new LinkedHashMap<>(props.size(), 1F);
        for (Entry<String, Object> entry : props.entrySet()) {
            if (!entry.getKey().contains(".")) {
                result.put(entry.getKey(), entry.getValue());
                continue;
            }
            String[] complexKeys = entry.getKey().split("\\.");
            if (2 != complexKeys.length) {
                result.put(entry.getKey(), entry.getValue());
                continue;
            }
            if (!result.containsKey(complexKeys[0])) {
                result.put(complexKeys[0], new Properties());
            }
            ((Properties) result.get(complexKeys[0])).setProperty(complexKeys[1], entry.getValue().toString());
        }
        return result;
    }
@Test
    void assertGetProperties() {
        Map<String, Object> actual = new CustomDataSourcePoolProperties(
                createProperties(), Arrays.asList("username", "password", "closed"), Collections.singletonList("closed"), Collections.singletonMap("username", "user")).getProperties();
        assertThat(actual.size(), is(3));
        assertThat(actual.get("foo"), is("bar"));
        assertThat(((Properties) actual.get("fooProperties")).size(), is(2));
        assertThat(((Properties) actual.get("fooProperties")).getProperty("foo1"), is("fooValue1"));
        assertThat(((Properties) actual.get("fooProperties")).getProperty("foo2"), is("fooValue2"));
        assertThat(((Properties) actual.get("barProperties")).size(), is(2));
        assertThat(((Properties) actual.get("barProperties")).getProperty("bar1"), is("barValue1"));
        assertThat(((Properties) actual.get("barProperties")).getProperty("bar2"), is("barValue2"));
    }