@Test
  public void testToByteArrayThrowsIOException() throws IOException {
    final InputStream mockIn = mock(InputStream.class, "testToByteArrayThrowsIOException");
    when(mockIn.read(any())).thenThrow(new IOException("Mock IOException"));
    assertThatThrownBy(() -> IOUtils.toByteArray(mockIn)).isInstanceOf(IOException.class)
        .hasMessage("Mock IOException");
  }
Gets a fully-qualified path anchored at root.
<p>

@param pathElements a String array containing the elements of the path.
@return a fully-qualified pathname as a String value.
geode-core/src/test/java/org/apache/geode/internal/util/IOUtilsJUnitTest.java