code: protected void checkResultType(ServiceResponse<?> serviceResponse, Class<?> expectedResultType) {
          Object actualResult = serviceResponse.getResult();
          if ( actualResult != null && !expectedResultType.isInstance( actualResult ) ) {
              throw new KieServicesException(
                      "Error while creating service response! The actual result type " +
                              serviceResponse.getResult().getClass() + " does not match the expected type " + expectedResultType + "!" );
          }
      }
docs: Checks whether the specified {@code ServiceResponse} contains the expected result type. In case the type is different,
  {@code KieServicesClientException} is thrown. This catches the errors early, before returning the result from the client.
  Without this check users could experience {@code ClassCastException} when retrieving the result that does not have
  the expected type.