code: private String getTopic(ServiceEvent serviceEvent) {
          StringBuilder topic = new StringBuilder(SERVICE_EVENT_TOPIC_PREFIX);
  
          switch (serviceEvent.getType()) {
              case ServiceEvent.REGISTERED:
                  topic.append("REGISTERED");
                  break;
              case ServiceEvent.MODIFIED:
                  topic.append("MODIFIED");
                  break;
              case ServiceEvent.UNREGISTERING:
                  topic.append("UNREGISTERING");
                  break;
              default:
                  return null;
          }
  
          return topic.toString();
      }
docs: Determine the appropriate topic to use for the Service Event.
  
  @param serviceEvent
  the service event that is being adapted
  @return the topic or null if the event is not supported