The dot .
is special regex character. It means match any. You need to escape the character, which in Java is done with \\
.
Once it is escaped, it won't be treated as special and will be matched just like any other character.
So String[] test2 = test.split("\\.");
should do the trick nicely!