### Question:
CronParser { static List<String> tokenize(String cron) throws IllegalArgumentException { StringTokenizer tokenize = new StringTokenizer(cron); List<String> result = new ArrayList<String>(); while (tokenize.hasMoreTokens()) { result.add(tokenize.nextToken()); } if (result.size() != NUMBER_TOKENS) { throw new IllegalArgumentException("Not a valid cron entry - wrong number of tokens(" + result.size() + "): " + cron); } return result; }  static long getNextScheduledTime(final String cronEntry, long currentTime); static void validate(final String cronEntry);  }### Answer:
@Test public void testTokenize() { String test = "*/5 * * * *"; List<String> list = CronParser.tokenize(test); assertEquals(list.size(), 5); test = "*/5 * * * * *"; try { list = CronParser.tokenize(test); fail("Should have throw an exception"); } catch (Throwable e) { } test = "*/5 * * * *"; try { list = CronParser.tokenize(test); fail("Should have throw an exception"); } catch (Throwable e) { } test = "0 1 2 3 4"; list = CronParser.tokenize(test); assertEquals(list.size(), 5); assertEquals(list.get(0), "0"); assertEquals(list.get(1), "1"); assertEquals(list.get(2), "2"); assertEquals(list.get(3), "3"); assertEquals(list.get(4), "4"); }