code: public static Optional<BeaconEvent> parse(Event event) {
          Matcher matcher = PATTERN.matcher(event.getTag());
          if (matcher.matches()) {
              BeaconEvent result = new BeaconEvent(matcher.group(1), matcher.group(2),
                      matcher.group(3), event.getData(JsonElement.class));
              return Optional.of(result);
          } else {
              return Optional.empty();
          }
      }
docs: Utility method to parse e generic event to a more specific one
  @param event the generic event to parse
  @return an option containing the parsed value or non if it could not be parsed