@Test
public void testWhiteSpacesToSingleSpace() {

    assertEquals(whiteSpacesToSingleSpace(null), null);
    assertEquals(whiteSpacesToSingleSpace(""), "");
    assertEquals(whiteSpacesToSingleSpace("asd"), "asd");
    assertEquals(whiteSpacesToSingleSpace("a  a"), "a a");
    assertEquals(whiteSpacesToSingleSpace(" "), " ");
    assertEquals(whiteSpacesToSingleSpace("\t"), " ");
    assertEquals(whiteSpacesToSingleSpace("\n"), " ");
    assertEquals(whiteSpacesToSingleSpace("\t \n"), " ");
    assertEquals(whiteSpacesToSingleSpace("  \t  \n\r \f"), " ");
    assertEquals(whiteSpacesToSingleSpace("  a\t a\r\fa"), " a a a");
}