public static <V> Map<String, V> entriesWithPrefix(Map<String, V> map, String prefix) {
        return entriesWithPrefix(map, prefix, true);
    }
@Test
    public void testEntriesWithPrefix() {
        Map<String, Object> props = new HashMap<>();
        props.put("foo.bar", "abc");
        props.put("setting", "def");

        // With stripping
        Map<String, Object> expected = Collections.singletonMap("bar", "abc");
        Map<String, Object> actual = Utils.entriesWithPrefix(props, "foo.");
        assertEquals(expected, actual);

        // Without stripping
        expected = Collections.singletonMap("foo.bar", "abc");
        actual = Utils.entriesWithPrefix(props, "foo.", false);
        assertEquals(expected, actual);
    }