### Question:
VertexLabel { public Optional<String> getOuterNamespace() { return namespace.stream().findFirst(); } VertexLabel(String name);  VertexLabel(String outer, String... inner);  VertexLabel(List<String> namespace, String name); boolean isInNamespace(String... namespace); VertexLabel withExtraNamespace(String topLevelNamespace); VertexLabel withoutOuterNamespace(); Optional<String> getOuterNamespace(); String getUnqualifiedName(); String getQualifiedName(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static VertexLabel parseLabel(String label);  }### Answer:
@Test public void youCanGetTheOuterNamespace() { String innerNamespace = "inner"; String outerNamespace = "outer"; String name = "foo"; VertexLabel foo = new VertexLabel(outerNamespace, innerNamespace, name); Optional<String> outerNamespace1 = foo.getOuterNamespace(); assertThat(outerNamespace1.get(), equalTo(outerNamespace)); }
@Test public void itReturnsEmptyIfYouAskForTheOuterNamespaceButThereIsntOne() { VertexLabel labelWithoutNamespace = new VertexLabel("foo"); assertThat(labelWithoutNamespace.getOuterNamespace().isPresent(), is(false)); }