@Test
  public void getEmptyUserMetadataInputTest() throws Exception {
    JSONObject headers = new JSONObject();
    setAmbryHeadersForPut(headers, Long.toString(RANDOM.nextInt(10000)), generateRandomString(10),
        Container.DEFAULT_PUBLIC_CONTAINER, "image/gif", generateRandomString(10));
    Map<String, String> userMetadata = new HashMap<String, String>();
    setUserMetadataHeaders(headers, userMetadata);

    RestRequest restRequest = createRestRequest(RestMethod.POST, "/", headers);
    byte[] userMetadataByteArray = RestUtils.buildUserMetadata(restRequest.getArgs());
    Map<String, String> userMetadataMap = RestUtils.buildUserMetadata(userMetadataByteArray);
    assertEquals("UserMetadata should have no entries ", 0, userMetadataMap.size());
  }
Tests building of User Metadata with empty input
@throws Exception
ambry-api/src/test/java/com/github/ambry/rest/RestUtilsTest.java