class App {

  /**
   * Program entry point.
   *
   * @param args command line args.
   */
  public static void main(String[] args) {

    useOfLoggedMute();

    useOfMute();
  }

  /*
   * Typically used when the API declares some exception but cannot do so. Usually a
   * signature mistake.In this example out is not supposed to throw exception as it is a
   * ByteArrayOutputStream. So we utilize mute, which will throw AssertionError if unexpected
   * exception occurs.
   */
  private static void useOfMute() {
    var out = new ByteArrayOutputStream();
    Mute.mute(() -> out.write("Hello".getBytes()));
  }

  private static void useOfLoggedMute() {<FILL_FUNCTION_BODY>}

  /*
   * All we can do while failed close of a resource is to log it.
   */
  private static void closeResource(Resource resource) {
    Mute.loggedMute(resource::close);
  }

  private static void utilizeResource(Resource resource) {
    LOGGER.info("Utilizing acquired resource: {}", resource);
  }

  private static Resource acquireResource() {
    return new Resource() {

      @Override
      public void close() throws IOException {
        throw new IOException("Error in closing resource: " + this);
      }
    };
  }
}

    Optional<Resource> resource = Optional.empty();
    try {
      resource = Optional.of(acquireResource());
      utilizeResource(resource.get());
    } finally {
      resource.ifPresent(App::closeResource);
    }
  
<no_super_class>