@Override
  public GcsPath getName(int count) {
    checkArgument(count >= 0);

    Iterator<Path> iterator = iterator();
    for (int i = 0; i < count; ++i) {
      checkArgument(iterator.hasNext());
      iterator.next();
    }

    checkArgument(iterator.hasNext());
    return (GcsPath) iterator.next();
  }
@Test
  public void testGetName() {
    GcsPath a = GcsPath.fromComponents("bucket", "a/b/c/d");
    assertEquals(5, a.getNameCount());
    assertThat(a.getName(0).toString(), Matchers.equalTo("gs://bucket/"));
    assertThat(a.getName(1).toString(), Matchers.equalTo("a"));
    assertThat(a.getName(2).toString(), Matchers.equalTo("b"));
    assertThat(a.getName(3).toString(), Matchers.equalTo("c"));
    assertThat(a.getName(4).toString(), Matchers.equalTo("d"));
  }