code: public static String getOverlappingWithGroupsTargetFilter(final String baseFilter, final List<RolloutGroup> groups,
              final RolloutGroup group) {
          final String groupFilter = group.getTargetFilterQuery();
          // when any previous group has the same filter as the target group the
          // overlap is 100%
          if (isTargetFilterInGroups(groupFilter, groups)) {
              return concatAndTargetFilters(baseFilter, groupFilter);
          }
          final String previousGroupFilters = getAllGroupsTargetFilter(groups);
          if (!StringUtils.isEmpty(previousGroupFilters)) {
              if (!StringUtils.isEmpty(groupFilter)) {
                  return concatAndTargetFilters(baseFilter, groupFilter, previousGroupFilters);
              } else {
                  return concatAndTargetFilters(baseFilter, previousGroupFilters);
              }
          }
          if (!StringUtils.isEmpty(groupFilter)) {
              return concatAndTargetFilters(baseFilter, groupFilter);
          } else {
              return baseFilter;
          }
      }
docs: Creates an RSQL Filter that matches all targets that are in the provided
  group and in the provided groups.
  
  @param baseFilter
  the base filter from the rollout
  @param groups
  the rollout groups
  @param group
  the target group
  @return RSQL string without base filter of the Rollout. Can be an empty
  string.