@Override
    public DataSource get() {
        if (highAvailableDataSource == null) {
            return null;
        }

        Map<String, DataSource> dataSourceMap = highAvailableDataSource.getAvailableDataSourceMap();
        if (dataSourceMap == null || dataSourceMap.isEmpty()) {
            return null;
        }
        if (dataSourceMap.size() == 1) {
            for (DataSource v : dataSourceMap.values()) {
                return v;
            }
        }
        String name = getTarget();
        if (name == null) {
            if (dataSourceMap.get(getDefaultName()) != null) {
                return dataSourceMap.get(getDefaultName());
            }
        } else {
            return dataSourceMap.get(name);
        }
        return null;
    }
@Test
    public void testEmptyMap() {
        dataSourceMap.clear();
        NamedDataSourceSelector selector = new NamedDataSourceSelector(null);
        assertNull(selector.get());
        selector = new NamedDataSourceSelector(dataSource);
        assertNull(selector.get());
    }