code: public static <I, O> CompactMealy<I, O> retainTransitionsWithOutput(MealyMachine<?, I, ?, O> in,
                                                                          Alphabet<I> inputs,
                                                                          Collection<? super O> outputs) {
          return filterByOutput(in, inputs, outputs::contains);
      }
docs: Returns a Mealy machine with all transitions removed that have an output not among the specified values. The
  resulting Mealy machine will not contain any unreachable states.
  
  @param in
  the input Mealy machine
  @param inputs
  the input alphabet
  @param outputs
  the outputs to retain
  
  @return a Mealy machine with all transitions retained that have one of the specified outputs.