@Test public void prepend() { assertArrayEquals(new String[] {}, SVGHelper.prepend(new String[] {}, (Object[]) null)); assertArrayEquals(new String[] { "1" }, SVGHelper.prepend(new String[] {}, new Object[] { 1 })); assertArrayEquals(new String[] { "1", "zwei" }, SVGHelper.prepend(new String[] {}, new Object[] { 1, "zwei" })); assertArrayEquals(new String[] { "3" }, SVGHelper.prepend(new String[] { "3" }, new Object[] {})); assertArrayEquals(new String[] { "1", "3" }, SVGHelper.prepend(new String[] { "3" }, new Object[] { 1 })); assertArrayEquals(new String[] { "1", "zwei", "3" }, SVGHelper.prepend(new String[] { "3" }, new Object[] { 1, "zwei" })); assertArrayEquals(new String[] { "1", "zwei", "3", "vier" }, SVGHelper.prepend(new String[] { "3", "vier" }, new Object[] { 1, "zwei" })); }
static String[] prepend(final String[] array, final Object... values) { if (values == null) { return array; } final String[] joinedArray = new String[values.length + array.length]; for (int i = 0; i < values.length; i++) { joinedArray[i] = String.valueOf(values[i]); } System.arraycopy(array, 0, joinedArray, values.length, array.length); return joinedArray; }
SVGHelper { static String[] prepend(final String[] array, final Object... values) { if (values == null) { return array; } final String[] joinedArray = new String[values.length + array.length]; for (int i = 0; i < values.length; i++) { joinedArray[i] = String.valueOf(values[i]); } System.arraycopy(array, 0, joinedArray, values.length, array.length); return joinedArray; } }
SVGHelper { static String[] prepend(final String[] array, final Object... values) { if (values == null) { return array; } final String[] joinedArray = new String[values.length + array.length]; for (int i = 0; i < values.length; i++) { joinedArray[i] = String.valueOf(values[i]); } System.arraycopy(array, 0, joinedArray, values.length, array.length); return joinedArray; }  }
SVGHelper { static String[] prepend(final String[] array, final Object... values) { if (values == null) { return array; } final String[] joinedArray = new String[values.length + array.length]; for (int i = 0; i < values.length; i++) { joinedArray[i] = String.valueOf(values[i]); } System.arraycopy(array, 0, joinedArray, values.length, array.length); return joinedArray; }  static Document createDocument(final double width, final double height); static void setAttribute(final Element element, final String attrName, final Object value); static String drawHorizontalConnectionLine(final GanttRelationType type, final double x1, final double y1, final double x2,
      final double y2, final double minXDist); static String drawArrow(final ArrowDirection direction, final double x, final double y, final double size); static Element createText(final Document document, final double x, final double y, final String text, final String... attributes); static Element createPath(final Document document, final String fill, final double strokeWidth, final String stroke,
      final String path, final String... attributes); static Element createPath(final Document document, final SVGColor fillColor, final double strokeWidth, final SVGColor strokeColor,
      final String path, final String... attributes); static Element createRect(final Document document, final double x, final double y, final double width, final double height,
      final String fill, final String... attributes); static Element createRect(final Document document, final double x, final double y, final double width, final double height,
      final SVGColor fillColor, final String... attributes); static Element createRect(final Document document, final double x, final double y, final double width, final double height,
      final SVGColor fillColor, final SVGColor strokeColor, final String... attributes); static Element createLine(final Document document, final double x1, final double y1, final double x2, final double y2,
      final SVGColor strokeColor, final String... attributes); static Element createLine(final Document document, final double x1, final double y1, final double x2, final double y2,
      final String... attributes); static Element createUse(final Document document, final String id, final double x, final double y, final String... attributes); static Element createElement(final Document document, final String tag, final SVGColor fillColor, final String... attributes); static Element createElement(final Document document, final String tag, final String... attributes); static String round(final double value); }
SVGHelper { static String[] prepend(final String[] array, final Object... values) { if (values == null) { return array; } final String[] joinedArray = new String[values.length + array.length]; for (int i = 0; i < values.length; i++) { joinedArray[i] = String.valueOf(values[i]); } System.arraycopy(array, 0, joinedArray, values.length, array.length); return joinedArray; }  static Document createDocument(final double width, final double height); static void setAttribute(final Element element, final String attrName, final Object value); static String drawHorizontalConnectionLine(final GanttRelationType type, final double x1, final double y1, final double x2,
      final double y2, final double minXDist); static String drawArrow(final ArrowDirection direction, final double x, final double y, final double size); static Element createText(final Document document, final double x, final double y, final String text, final String... attributes); static Element createPath(final Document document, final String fill, final double strokeWidth, final String stroke,
      final String path, final String... attributes); static Element createPath(final Document document, final SVGColor fillColor, final double strokeWidth, final SVGColor strokeColor,
      final String path, final String... attributes); static Element createRect(final Document document, final double x, final double y, final double width, final double height,
      final String fill, final String... attributes); static Element createRect(final Document document, final double x, final double y, final double width, final double height,
      final SVGColor fillColor, final String... attributes); static Element createRect(final Document document, final double x, final double y, final double width, final double height,
      final SVGColor fillColor, final SVGColor strokeColor, final String... attributes); static Element createLine(final Document document, final double x1, final double y1, final double x2, final double y2,
      final SVGColor strokeColor, final String... attributes); static Element createLine(final Document document, final double x1, final double y1, final double x2, final double y2,
      final String... attributes); static Element createUse(final Document document, final String id, final double x, final double y, final String... attributes); static Element createElement(final Document document, final String tag, final SVGColor fillColor, final String... attributes); static Element createElement(final Document document, final String tag, final String... attributes); static String round(final double value);  }