### Question:
FilenameParser { public String next() { if ( offset > name.length() ) { return null; } if ( matcher.find( offset ) ) { offset = matcher.end() + 1; return matcher.group(); } return null; } FilenameParser( String filename ); void reset(); String next(); String getExtension(); String remaining(); String nextNonVersion();  }### Answer:
@Test public void testNext() { FilenameParser parser = new FilenameParser( "maven-test-plugin-1.8.3.jar" ); assertEquals( "maven-test-plugin-1.8.3", parser.getName() ); assertEquals( "jar", parser.getExtension() ); assertEquals( "maven", parser.next() ); assertEquals( "test", parser.next() ); assertEquals( "plugin", parser.next() ); assertEquals( "1.8.3", parser.next() ); assertNull( parser.next() ); }