public static DatabaseType get(final String url) {
        Collection<DatabaseType> databaseTypes = ShardingSphereServiceLoader.getServiceInstances(DatabaseType.class).stream().filter(each -> matchURLs(url, each)).collect(Collectors.toList());
        ShardingSpherePreconditions.checkNotEmpty(databaseTypes, () -> new UnsupportedStorageTypeException(url));
        for (DatabaseType each : databaseTypes) {
            if (!each.getTrunkDatabaseType().isPresent()) {
                return each;
            }
        }
        return databaseTypes.iterator().next();
    }
@Test
    void assertGetDatabaseTypeWithBranchURL() {
        assertThat(DatabaseTypeFactory.get("jdbc:trunk:branch://localhost:3306/test?databaseType=BRANCH").getType(), is("TRUNK"));
    }