Advertisement
sergAccount

Untitled

Mar 28th, 2021
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.app21;
  7.  
  8. import java.util.function.Predicate;
  9.  
  10. public class MyFilter implements Predicate<String> {
  11.    
  12.     private int limit;
  13.    
  14.     public MyFilter(int limit){
  15.         this.limit = limit;
  16.     }
  17.     //
  18.     @Override
  19.     public boolean test(String s) {
  20.         return s.length() > limit;
  21.     }  
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement