BaseCommand { public void setPath(final String path) { if (StringUtils.isEmpty(path)) { this.path = "/"; } else { if (path.startsWith("/")) { this.path = path; } else { this.path = "/" + path; } } } BaseCommand(); String getPath(); String getEncodedPath(); void setPath(final String path); Revision getRevision(); void setRevision(final Revision revision); void setPegRevision(final Revision pegRevision); Revision getPegRevision(); boolean hasPegRevision(); long getRevisionNumber(); String getTarget(); String getEncodedTarget(); String getParentPath(); String getPathPart(); DirEntryComparator.SortType getSortType(); void setSortType(final DirEntryComparator.SortType sortType); DirEntrySorter.SortMode getSortMode(); void setSortMode(final DirEntrySorter.SortMode sortMode); void setName(final RepositoryName name); RepositoryName getName(); @Override boolean equals(final Object obj); @Override int hashCode(); String createListUrl(); String createShowFileUrl(); String getPathWithTrailingSlash(); @Override String toString();  }
@Test public void testSetPath() { final BaseCommand command = new BaseCommand(); command.setPath(null); assertEquals("/", command.getPath()); command.setPath(""); assertEquals("/", command.getPath()); command.setPath("Asdf.java"); assertEquals("/Asdf.java", command.getPath()); }