public static String parametersToString(Object... objs) {
    StringBuilder sb = new StringBuilder("(");
    if (objs != null) {
      for (int k = 0; k < objs.length; k++) {
        if (k != 0) {
          sb.append(", ");
        }
        if (objs[k] == null) {
          sb.append("null");
        } else {
          sb.append(objs[k].toString());
        }
      }
    }
    sb.append(")");
    return sb.toString();
  }
@Test
  public void parametersToString() {
    class TestCase {
      String mExpected;
      Object[] mInput;

      public TestCase(String expected, Object[] objs) {
        mExpected = expected;
        mInput = objs;
      }
    }

    List<TestCase> testCases = new ArrayList<>();
    testCases.add(new TestCase("()", null));
    testCases.add(new TestCase("(null)", new Object[] {null}));
    testCases.add(new TestCase("()", new Object[] {""}));
    testCases.add(new TestCase("(foo)", new Object[] {"foo"}));
    testCases.add(new TestCase("(foo, bar)", new Object[] {"foo", "bar"}));
    testCases.add(new TestCase("(foo, , bar)", new Object[] {"foo", "", "bar"}));
    testCases.add(new TestCase("(, foo, )", new Object[] {"", "foo", ""}));
    testCases.add(new TestCase("(, , )", new Object[] {"", "", ""}));
    testCases.add(new TestCase("(1)", new Object[] {1}));
    testCases.add(new TestCase("(1, 2, 3)", new Object[] {1, 2, 3}));

    for (TestCase testCase : testCases) {
      assertEquals(testCase.mExpected, FormatUtils.parametersToString(testCase.mInput));
    }
  }