class MongoUtil {

    public static String replicaSetUsedIn(String addresses) {
        if (addresses.startsWith("[")) {
            // Just an IPv6 address, so no replica set name ...
            return null;
        }
        // Either a replica set name + an address, or just an IPv4 address ...
        int index = addresses.indexOf('/');
        if (index < 0) {
            return null;
        }
        return addresses.substring(0, index);
    }

    private  MongoUtil();

}