public static <T> T getRandomElement(T[] elements) {
    return elements[RANDOM.nextInt(elements.length)];
  }
Gets a random element from the given array of elements.
@param elements the array of elements.
@param <T> the type of the elements.
ambry-test-utils/src/main/java/com/github/ambry/utils/TestUtils.java