Data structore to support ranges and multi values

I'm looking for a data structure such that I can have ranges mapped to value, and these ranges can also be intersected, something like this

[1, 100) -> A merge with [2, 50) -> B

will become like this:

[1, 2) -> A,
[2, 50) -> A,B
[50, 100) -> A

I have this code using Google's RangeMap but it doesn't solve the problem since the new key will overwrite the old key if exists (as expected). this is a code example:

    private RangeMap<Comparable, String> buildTreeRangeMap (Map<String, VersionRangedValue> versionsMappings) {
        RangeMap<Comparable, String> treeRangeMap = TreeRangeMap.create();
        for (String version : versionsMappings.keySet()) {
            Version minVersion = new Version(versionsMappings.get(version).getMinSdkVersion());
            Version maxVersion = new Version(versionsMappings.get(version).getMaxSdkVersion());
            String value = versionsMappings.get(version).getValue();
            treeRangeMap.put(Range.closedOpen(minVersion, maxVersion), value);
        return treeRangeMap;

Is there any data structure in Java that anyone can recommend to me to solve the problem?