### Question:
SvgConvertUtils { public static Vector2f[] pathDataToVector2fList(String d) { StringTokenizer tokens = new StringTokenizer(d, ", "); ArrayList<Vector2f> pointList = new ArrayList<Vector2f>(); Vector2f currentLocation = new Vector2f(0f, 0f); Command currentCommand = Command.None; while (tokens.hasMoreTokens()) { String token = tokens.nextToken(); Command command = commandMap.get(token); if (command != null) { currentCommand = command; continue; } if (currentCommand == Command.None) continue; if (currentCommand == Command.RelativeMoveTo || currentCommand == Command.RelativeLineTo) { float xr = Float.parseFloat(token); float yr = Float.parseFloat(tokens.nextToken()); float x = xr + currentLocation.x; float y = yr + currentLocation.y; pointList.add(new Vector2f(x, y)); currentLocation.set(x, y); } else if (currentCommand == Command.AbsoluteMoveTo || currentCommand == Command.AbsoluteLineTo) { float x = Float.parseFloat(token); float y = Float.parseFloat(tokens.nextToken()); pointList.add(new Vector2f(x, y)); currentLocation.set(x, y); } else { throw new UnsupportedOperationException(currentCommand.toString() + " not supported yet"); } } Vector2f[] points = new Vector2f[pointList.size()]; pointList.toArray(points); return points; }  static SvgGroup getSvgGroup(Element element); static SvgImage getSvgImage(Element element); static SvgPath getSvgPath(Element element); static Vector2f[] pathDataToVector2fList(String d); static Color fillColorFromStyle(String style); static Color fillColorFromStyle(Color color, String style); static String getFillFromStyle(String style); static String getFillOpacityFromStyle(String style); static String replicateHexNotation(CharSequence hexColor); static Color colorValue(String colorValue); static Color colorValue(Color color, String colorValue); static float opacityValue(String opacityValue); static SvgElementConverter<SvgGroup> groupConverter(); static SvgElementConverter<SvgImage> imageConverter(); static SvgElementConverter<SvgPath> pathConverter();  }### Answer:
@Test public void testPathDataConversionUsingRelativeMoveTo() { String pathWithRelativeMove = "m 28.0,258.0 668.0,0 0,347.0 -668.0,0 z"; Vector2f[] points = SvgConvertUtils.pathDataToVector2fList(pathWithRelativeMove); assertVectorEquals(28f, 258f, points[0]); assertVectorEquals(28f + 668f, 258f, points[1]); assertVectorEquals(28f + 668f, 258f + 347f, points[2]); assertVectorEquals(28f + 668f - 668f, 258f + 347f, points[3]); }
@Test public void testPathDataConversionUsingAbsoluteMoveTo() { String pathWithRelativeMove = "M 28.0,258.0 668.0,0 0,347.0 -668.0,0 z"; Vector2f[] points = SvgConvertUtils.pathDataToVector2fList(pathWithRelativeMove); assertVectorEquals(28f, 258f, points[0]); assertVectorEquals(668f, 0f, points[1]); assertVectorEquals(0f, 347f, points[2]); assertVectorEquals(-668f, 0f, points[3]); }
@Test public void testComplexPathWithLinesAndMoveTo() { String pathWithRelativeMove = "M 100 100 L 300 100 L 200 300 z"; Vector2f[] points = SvgConvertUtils.pathDataToVector2fList(pathWithRelativeMove); assertVectorEquals(100f, 100f, points[0]); assertVectorEquals(300f, 100f, points[1]); assertVectorEquals(200f, 300f, points[2]); }