public static String[] decodeArray(String s) {
    if (s == null)
      return null;

    String[] escaped = StringUtils.split(s);
    String[] plain = new String[escaped.length];

    for (int i = 0; i < escaped.length; ++i)
      plain[i] = StringUtils.unEscapeString(escaped[i]);

    return plain;
  }
@Test
  public void testDecodeArray() {
    Assert.assertTrue(TempletonUtils.encodeArray((String[]) null) == null);
    String[] tmp = new String[3];
    tmp[0] = "fred";
    tmp[1] = null;
    tmp[2] = "peter,lisa,, barney";
    String[] tmp2 = TempletonUtils.decodeArray(TempletonUtils.encodeArray(tmp));
    try {
      for (int i=0; i< tmp.length; i++) {
        Assert.assertEquals((String) tmp[i], (String)tmp2[i]);
      }
    } catch (Exception e) {
      Assert.fail("Arrays were not equal" + e.getMessage());
    }
  }