This java example will show how to split a string into an array using a regular expression. First defining a pattern and passing a space will split the character sequence by a space. Once it is split we will write a unit test and validate the elements using hamcrest arrayContaining.
Straight up Java