code: public static Stream<String> getResourceTypes(final Event event) {
          if (event instanceof org.modeshape.jcr.api.observation.Event) {
              try {
                  final org.modeshape.jcr.api.observation.Event modeEvent =
                          (org.modeshape.jcr.api.observation.Event) event;
                  final Stream.Builder<NodeType> types = Stream.builder();
                  for (final NodeType type : modeEvent.getMixinNodeTypes()) {
                      types.add(type);
                  }
                  types.add(modeEvent.getPrimaryNodeType());
                  return types.build().map(NodeType::getName);
              } catch (final RepositoryException e) {
                  throw new RepositoryRuntimeException(e);
              }
          }
          return empty(); // wasn't a ModeShape event, so we have no access to resource types
      }
docs: Get the RDF Types of the resource corresponding to this JCR Event
  @param event the JCR event
  @return the types recorded on the resource associated to this event