### Question:
SpTokenizer implements Tokenizer { SpProcessor getProcessor() { return processor; } SpTokenizer(Path modelPath, String prefix); @Override List<String> tokenize(String sentence); @Override String buildSentence(List<String> tokens);  }### Answer:
@Test public void testEncodeDecode() throws IOException { if (System.getProperty("os.name").startsWith("Win")) { throw new SkipException("Skip windows test."); } Path modelPath = Paths.get("build/test/models"); String prefix = "sententpiece_test_model"; SpTokenizer tokenizer = new SpTokenizer(modelPath, prefix); String original = "Hello World"; SpProcessor processor = tokenizer.getProcessor(); int[] ids = processor.encode(original); int[] expected = new int[] {151, 88, 21, 4, 321, 54, 31, 17}; Assert.assertEquals(ids, expected); String recovered = processor.decode(ids); Assert.assertEquals(recovered, original); }