### Question:
GraphName { public boolean isPrivate() { return !isEmpty() && name.charAt(0) == '~'; } 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); static final String VALID_GRAPH_NAME_REGEXP; static final Pattern VALID_GRAPH_NAME_PATTERN; }### Answer:
@Test public void testIsPrivate() { String[] tests = { "~name", "~name/sub" }; for (String t : tests) { assertTrue(GraphName.of(t).isPrivate()); } String[] fails = { "", "not_private", "not/private", "/" }; for (String f : fails) { assertFalse(GraphName.of(f).isPrivate()); } }