package remonsinnema.blog.fizzbuzz;

import java.util.Optional;


public class MultipleReplacer {

  private final int value;
  private final String text;

  public MultipleReplacer(int value, String text) {
    this.value = value;
    this.text = text;
  }

  public Optional<String> textFor(int n) {
    if (n % value == 0) {
      return Optional.of(text);
    }
    return Optional.empty();
  }

}

@@ -299,36 +299,8 @@
 ) %7B%0A
-    if (n %25 value == 0) %7B%0A  
     
@@ -327,42 +327,50 @@
 ext)
-;
 %0A    
-%7D%0A
     
-return Optional.empty(
+.filter(ignored -%3E n %25 value == 0
 );%0A 

Replace if with filter