
/*
Online Java - IDE, Code Editor, Compiler

Online Java is a quick and easy tool that helps you to build, compile, test your programs online.
*/

import java.util.function.Predicate;
import java.util.*;

public class Predicatetest
{
    public static void main(String[] args) {
    System.out.println("Welcome to Online IDE!! Happy Coding :)");
        
    List <String> lst = new ArrayList<String>();
        
    String ff = "text";
    int count=0;
        
    //Let us assume this is the data added first time around (as per document)
    //this would be stored as an offset of completing C(5,5)
    //it can be seen following.
        
    //sum  //total    //total - subset 
    lst.add("{ {10},  {10}, {65} }");
    lst.add("{ {10,15},  {25}, {50} }");
    lst.add("{10,15,20},  {45}, {30} }");
    lst.add("{ {10,15,20,25},  {65}, {10} }");
    lst.add("{ {10,15,20,25,5},  {65}, {10} }");
        
    //if the following set entry was derived subsequently
    // number = {10,15,25,20,5}
    //I would perform a lookup to check if this was present in the list before
    //adding it again..
    //perhaps my approach would be suitable if I was trying to use a list for
    //storage (since it lacks inability to identify repetition.)
        
    //String number="{ {10,15,25,20,5}";  //not a match
    String number="{ {10,15,20,25,5}";   //this would be a match
        
    Predicate<String> filtertest = x ->x.contains(number);
        
    //can not use notation as such to get the index
    //System.out.println("match found: " + count);
    //also unable to determine a way if there is a match,
    //tried various techniques...
    //so it would be difficult to implement this in the challenges..
    //unless I get a strong understanding of the principles..
   
    lst.stream().filter(t -> filtertest.test(t)).forEach(System.out::println);
    //count++;
        
    }
}