public PathSpecSet copyWithScope(PathSpec parent)
  {
    if (this.isAllInclusive())
    {
      return PathSpecSet.of(parent);
    }

    if (this.isEmpty())
    {
      return PathSpecSet.empty();
    }

    Builder builder = newBuilder();

    this.getPathSpecs().stream()
        .map(childPathSpec -> {
          List<String> parentPathComponents = parent.getPathComponents();
          List<String> childPathComponents = childPathSpec.getPathComponents();
          ArrayList<String> list = new ArrayList<>(parentPathComponents.size() + childPathComponents.size());
          list.addAll(parentPathComponents);
          list.addAll(childPathComponents);
          return list;
        })
        .map(PathSpec::new)
        .forEach(builder::add);

    return builder.build();
  }
@Test(dataProvider = "copyWithScopeProvider")
  public void testCopyWithScope(PathSpecSet input, PathSpec parent, PathSpecSet expected) {
    Assert.assertEquals(input.copyWithScope(parent), expected);
  }