@CanIgnoreReturnValue
  public PathSubject hasNameComponents(String... names) {
    ImmutableList.Builder<String> builder = ImmutableList.builder();
    for (Path name : actual) {
      builder.add(name.toString());
    }

    if (!builder.build().equals(ImmutableList.copyOf(names))) {
      failWithActual("expected components", asList(names));
    }
    return this;
  }
Asserts that the path has the given name components.
jimfs/src/test/java/com/google/common/jimfs/PathSubject.java