@Test
public void testParseDoubleArray() {

    assertFalse(StringUtils.parseDoubleArray(null, ',').isPresent());
    assertFalse(StringUtils.parseDoubleArray("", ',').isPresent());
    assertFalse(StringUtils.parseDoubleArray("foo", ',').isPresent());
    assertFalse(StringUtils.parseDoubleArray(",123.0,333.0,652.0", ',').isPresent());
    assertFalse(StringUtils.parseDoubleArray("123.0,333.0,652.0,", ',').isPresent());
    assertArrayEquals(new double[] { 123.0, -333.0, 652.0 },
            StringUtils.parseDoubleArray("123.0,-333.0,652", ',').get(), 0.0);
    double[] arr = new double[17];
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < arr.length; i++) {
        double factor = i % 2 == 0 ? -2.0 : 2.0;
        double d = factor * i;
        arr[i] = d;
        if (i > 0) {
            sb.append(',');
        }
        sb.append(d);
    }
    assertArrayEquals(arr, StringUtils.parseDoubleArray(sb.toString(), ',').get(), 0.0);
}