Since the arguments to replace aren’t regular expressions, you shouldn’t use \\ to escape anything in them. Just test.replace("|", "__").replace("/", "__") will do the same thing as the calls to replaceAll, but without the overhead of constructing regular expressions and without the visual clutter of the backslashes.
Though in this particular case where both characters are replaced with the same replacement string, you could instead also use a single call to replaceAll to replace both at the same time:
text.replaceAll("[|/]", "__")
PS: Slashes aren’t special characters in Java regular expressions, so you don’t have to escape them.