@Test public void testJoin() { assertEquals(GraphName.of("/bar"), GraphName.of("/").join(GraphName.of("bar"))); assertEquals(GraphName.of("bar"), GraphName.of("").join(GraphName.of("bar"))); assertEquals(GraphName.of("bar"), GraphName.of("bar").join(GraphName.of(""))); assertEquals(GraphName.of("foo/bar"), GraphName.of("foo").join(GraphName.of("bar"))); assertEquals(GraphName.of("/foo/bar"), GraphName.of("/foo").join(GraphName.of("bar"))); assertEquals(GraphName.of("/bar"), GraphName.of("/foo").join(GraphName.of("/bar"))); }
public GraphName join(GraphName other) { if (other.isGlobal() || isEmpty()) { return other; } if (isRoot()) { return other.toGlobal(); } if (other.isEmpty()) { return this; } return new GraphName(toString() + SEPARATOR + other.toString()); }
GraphName { public GraphName join(GraphName other) { if (other.isGlobal() || isEmpty()) { return other; } if (isRoot()) { return other.toGlobal(); } if (other.isEmpty()) { return this; } return new GraphName(toString() + SEPARATOR + other.toString()); } }
GraphName { public GraphName join(GraphName other) { if (other.isGlobal() || isEmpty()) { return other; } if (isRoot()) { return other.toGlobal(); } if (other.isEmpty()) { return this; } return new GraphName(toString() + SEPARATOR + other.toString()); } private  GraphName(String name); }
GraphName { public GraphName join(GraphName other) { if (other.isGlobal() || isEmpty()) { return other; } if (isRoot()) { return other.toGlobal(); } if (other.isEmpty()) { return this; } return new GraphName(toString() + SEPARATOR + other.toString()); } private  GraphName(String name); static GraphName newAnonymous(); static GraphName root(); static GraphName empty(); static GraphName of(String name); boolean isGlobal(); boolean isRoot(); boolean isEmpty(); boolean isPrivate(); boolean isRelative(); GraphName getParent(); GraphName getBasename(); GraphName toRelative(); GraphName toGlobal(); GraphName join(GraphName other); GraphName join(String other); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
GraphName { public GraphName join(GraphName other) { if (other.isGlobal() || isEmpty()) { return other; } if (isRoot()) { return other.toGlobal(); } if (other.isEmpty()) { return this; } return new GraphName(toString() + SEPARATOR + other.toString()); } private  GraphName(String name); static GraphName newAnonymous(); static GraphName root(); static GraphName empty(); static GraphName of(String name); boolean isGlobal(); boolean isRoot(); boolean isEmpty(); boolean isPrivate(); boolean isRelative(); GraphName getParent(); GraphName getBasename(); GraphName toRelative(); GraphName toGlobal(); GraphName join(GraphName other); GraphName join(String other); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }