code: public static File siblingDirectory(final File f, final String siblingDirName) {
      checkNotNull(f);
      checkNotNull(siblingDirName);
      checkArgument(!siblingDirName.isEmpty());
  
      final File parent = f.getParentFile();
      if (parent != null) {
        return new File(parent, siblingDirName);
      } else {
        throw new RuntimeException(String
            .format("Cannot create sibling directory %s of %s because the latter has no parent.",
                siblingDirName, f));
      }
    }
docs: Given a file, returns a File representing a sibling directory with the specified name.
  
  @param f              If f is the filesystem root, a runtime exeption will be thrown.
  @param siblingDirName The non-empty name of the sibling directory.