code: private static String cleanIdentifier(final String identifier) {
          final String id = identifier.split("#")[0].split("\\?")[0];
          if (id.endsWith("/")) {
              return id.substring(0, id.length() - 1);
          }
          return id;
      }
docs: Clean the identifier.
  
  @param identifier the identifier
  @return the cleaned identifier