### Question:
NodeRef implements Bounded, Comparable<NodeRef> { public static List<String> allPathsTo(final @NonNull String path) { checkArgument(!path.isEmpty()); StringBuilder sb = new StringBuilder(); List<String> paths = Lists.newArrayList(); final String[] steps = path.split("" + PATH_SEPARATOR); int i = 0; do { sb.append(steps[i]); paths.add(sb.toString()); sb.append(PATH_SEPARATOR); i++; } while (i < steps.length); return paths; } NodeRef(@NonNull Node node, String parentPath, @NonNull ObjectId metadataId); NodeRef update(final ObjectId newId, final @Nullable Envelope newBounds); static NodeRef createRoot(Node node); static NodeRef create(String parentPath, Node node); static NodeRef create(String parentPath, Node node, ObjectId metadataId); String getParentPath(); Node getNode(); String path(); String name(); @Override ObjectId getObjectId(); ObjectId getMetadataId(); ObjectId getDefaultMetadataId(); RevObject.TYPE getType(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(NodeRef o); @Override String toString(); static @Nullable String parentPath(@Nullable String fullPath); static void checkValidPath(final String path); static @Nullable String nodeFromPath(@Nullable String fullPath); static boolean isDirectChild(@NonNull String parentPath, @NonNull String nodePath); static boolean isChild(@NonNull String parentPath, @NonNull String nodePath); static List<String> allPathsTo(final @NonNull String path); static List<String> split(final @NonNull String path); static String appendChild(String parentTreePath, @NonNull String childName); @Override boolean intersects(Envelope env); @Override void expand(Envelope env); static int depth(String path); static String removeParent(final String parentPath, final String childPath); @Override Optional<Envelope> bounds(); static NodeRef tree(@NonNull String treePath, @NonNull ObjectId id,
            @NonNull ObjectId metadataId); static final String ROOT; static final char PATH_SEPARATOR; }### Answer:
@Test public void testAllPathsTo() { try { allPathsTo(null); fail("Expected precondition violation"); } catch (NullPointerException e) { assertTrue(true); } try { allPathsTo(""); fail("Expected precondition violation"); } catch (IllegalArgumentException e) { assertTrue(true); } assertEquals(ImmutableList.of("path"), allPathsTo("path")); assertEquals(ImmutableList.of("path", "path/to"), allPathsTo("path/to")); assertEquals(ImmutableList.of("path", "path/to", "path/to/node"), allPathsTo("path/to/node")); }