### Question:
CsvInspector { public String guessDelimiter( String line ) { int numTabs = 0; int numCommas = 0; int numPipes = 0; int numTildas = 0; int numColons = 0; int numSemiColons = 0; for ( int idx = 0; idx < line.length(); idx++ ) { char c = line.charAt( idx ); switch( c ) { case '\t': numTabs++; break; case ',': numCommas++; break; case '|': numPipes++; break; case '~': numTildas++; break; case ':': numColons++; break; case ';': numSemiColons++; break; } } int max = Math.max( numTabs, numCommas ); max = Math.max( max, numPipes ); max = Math.max( max, numTildas ); max = Math.max( max, numColons ); max = Math.max( max, numSemiColons ); if ( max == 0 ) { return null; } if ( max == numCommas ) { return ","; } if ( max == numTabs ) { return "\t"; } if ( max == numPipes ) { return "|"; } if ( max == numTildas ) { return "~"; } if ( max == numColons ) { return ":"; } if ( max == numSemiColons ) { return ";"; } return null; }  int determineFileFormat( String line ); List<String> getColumnData( int columnNumber, String[][] data ); String guessDelimiter( String line );  }### Answer:
@Test public void testGuessDelimiter() { CsvInspector inspector = new CsvInspector(); String line = "12;24;45"; assertEquals( ";", inspector.guessDelimiter( line ) ); line = "12,24,45"; assertEquals( ",", inspector.guessDelimiter( line ) ); line = "12~24~45"; assertEquals( "~", inspector.guessDelimiter( line ) ); line = "12:24:45"; assertEquals( ":", inspector.guessDelimiter( line ) ); line = "12\t24\t45"; assertEquals( "\t", inspector.guessDelimiter( line ) ); line = "12|24|45"; assertEquals( "|", inspector.guessDelimiter( line ) ); line = "12 2 24 5 45 8"; assertEquals( true, null == inspector.guessDelimiter( line ) ); }