### Question:
ProtocolInternalUtils { public static Throwable createRootRangeException(String streamName, StatusCode statusCode) { switch (statusCode) { case INVALID_NAMESPACE_NAME: return new InvalidNamespaceNameException(streamName); case NAMESPACE_EXISTS: return new NamespaceExistsException(streamName); case NAMESPACE_NOT_FOUND: return new NamespaceNotFoundException(streamName); case INVALID_STREAM_NAME: return new InvalidStreamNameException(streamName); case STREAM_EXISTS: return new StreamExistsException(streamName); case STREAM_NOT_FOUND: return new StreamNotFoundException(streamName); default: return new ClientException("fail to access its root range : code = " + statusCode); } } private  ProtocolInternalUtils(); static HashStreamRanges createActiveRanges(GetActiveRangesResponse response); static Throwable createRootRangeException(String streamName, StatusCode statusCode); static Exception createMetaRangeException(String name,
                                                     StatusCode statusCode);  }### Answer:
@Test public void testCreateRootRangeException() { String name = "test-create-root-range-exception"; Throwable cause1 = createRootRangeException(name, StatusCode.STREAM_EXISTS); assertTrue(cause1 instanceof StreamExistsException); StreamExistsException see = (StreamExistsException) cause1; Throwable cause2 = createRootRangeException(name, StatusCode.STREAM_NOT_FOUND); assertTrue(cause2 instanceof StreamNotFoundException); StreamNotFoundException snfe = (StreamNotFoundException) cause2; Throwable invalidStreamNameCause = createRootRangeException(name, StatusCode.INVALID_STREAM_NAME); assertTrue(invalidStreamNameCause instanceof InvalidStreamNameException); InvalidStreamNameException isne = (InvalidStreamNameException) invalidStreamNameCause; Throwable cause3 = createRootRangeException(name, StatusCode.FAILURE); ClientException se = (ClientException) cause3; assertEquals("fail to access its root range : code = " + StatusCode.FAILURE, se.getMessage()); Throwable cause5 = createRootRangeException(name, StatusCode.NAMESPACE_EXISTS); assertTrue(cause5 instanceof NamespaceExistsException); Throwable cause6 = createRootRangeException(name, StatusCode.NAMESPACE_NOT_FOUND); assertTrue(cause6 instanceof NamespaceNotFoundException); Throwable cause7 = createRootRangeException(name, StatusCode.INVALID_NAMESPACE_NAME); assertTrue(cause7 instanceof InvalidNamespaceNameException); }