public static Optional<StopEvent> createStopEvent(Identification source, Identification target) {
        if (target == null || target.equals(source))
            return Optional.empty();
        try {
            StopEvent stopRequest = new StopEvent(source);
            stopRequest.addResource(new SelectorResource(source, target));
            return Optional.of(stopRequest);
        } catch (IllegalArgumentException e) {
            return Optional.empty();
        }
    }
public static Optional < StopEvent > createStopEvent ( Identification source , Identification target ) { if ( target == null || target . equals ( source ) ) return Optional . empty ( ) ; try { StopEvent stopRequest = new StopEvent ( source ) ; stopRequest . addResource ( new SelectorResource ( source , target ) ) ; return Optional . of ( stopRequest ) ; } catch ( IllegalArgumentException e ) { return Optional . empty ( ) ; } }
creates a new StopEvent
@param source the caller
@param target the target who should start playing
@return the optional StartMusicRequest