### Question:
JRobinRrdStrategy implements RrdStrategy<RrdDef,RrdDb> { public static String[] tokenizeWithQuotingAndEscapes(String line, String delims, boolean processQuoted) { return tokenizeWithQuotingAndEscapes(line, delims, processQuoted, ""); } JRobinRrdStrategy(); Properties getConfigurationProperties(); void setConfigurationProperties(final Properties configurationParameters); void closeFile(final RrdDb rrdFile); RrdDef createDefinition(final String creator,
			final String directory, final String rrdName, int step,
			final List<RrdDataSource> dataSources, final List<String> rraList); void createFile(final RrdDef rrdDef,  Map<String, String> attributeMappings); RrdDb openFile(final String fileName); void updateFile(final RrdDb rrdFile, final String owner, final String data); Double fetchLastValue(final String fileName, final String ds, final int interval); Double fetchLastValue(final String fileName, final String ds, final String consolidationFunction, final int interval); Double fetchLastValueInRange(final String fileName, final String ds, final int interval, final int range); InputStream createGraph(final String command, final File workDir); RrdGraphDetails createGraphReturnDetails(final String command, final File workDir); void promoteEnqueuedFiles(Collection<String> rrdFiles); String getStats(); int getGraphLeftOffset(); int getGraphRightOffset(); int getGraphTopOffsetWithText(); String getDefaultFileExtension(); static String[] tokenizeWithQuotingAndEscapes(String line, String delims, boolean processQuoted); static String[] tokenizeWithQuotingAndEscapes(final String line, final String delims, final boolean processQuoted, final String tokens); static char[] escapeIfNotPathSepInDEF(final char encountered, final char escaped, final StringBuffer currToken);  }### Answer:
@Test public void testTWQnENoQNoE() throws Exception { String input = "This string has no quoting and no escapes"; String[] expected = new String[] { "This", "string", "has", "no", "quoting", "and", "no", "escapes" }; String[] actual = JRobinRrdStrategy.tokenizeWithQuotingAndEscapes(input, " ", false, ""); assertEquals(Arrays.asList(expected), Arrays.asList(actual)); }
@Test public void testTWQnENoQNoEWithDEFUnix() throws Exception { if (File.separatorChar != '/') { MockUtil.println("-------- Skipping testTWQnENoQNoEWithDEFUnix since File.separator is not / ------------"); MockUtil.println("-------- Be sure to run the tests on Unix too! ---------"); return; } String input = "No quote, no escapes, but DEF:test=snmp/42/test.jrb:test:AVERAGE"; String[] expected = new String[] { "No", "quote,", "no", "escapes,", "but", "DEF:test=snmp/42/test.jrb:test:AVERAGE" }; String[] actual = JRobinRrdStrategy.tokenizeWithQuotingAndEscapes(input, " ", false, ""); assertEquals(Arrays.asList(expected), Arrays.asList(actual)); }
@Test public void testTWQnENoQNoEWithDEFWindows() throws Exception { if (File.separatorChar != '\\') { MockUtil.println("-------- Skipping testTWQnENoQNoEWithDEFWindows since File.separator is not \\ ------------"); MockUtil.println("-------- Be sure to run the tests on Windows too! ---------"); return; } String input = "No quote, no escapes, but DEF:test=snmp\\42\\test.jrb:test:AVERAGE"; String[] expected = new String[] { "No", "quote,", "no", "escapes,", "but", "DEF:test=snmp\\42\\test.jrb:test:AVERAGE" }; String[] actual = JRobinRrdStrategy.tokenizeWithQuotingAndEscapes(input, " ", false, ""); assertEquals(Arrays.asList(expected), Arrays.asList(actual)); }