private static boolean addIfMatches(List<String> container,String statusLine,char x,char y){
  if (matches(statusLine,x,y)) {
    final String filename=statusLine.substring(3);
    if (!container.contains(filename)) {
      container.add(filename);
    }
    return true;
  }
  return false;
}

private static boolean addIfMatches ( List < String > container , String statusLine , char x , char y ) { if ( matches ( statusLine , x , y ) ) { final String filename = statusLine . substring ( 3 ) ; if ( ! container . contains ( filename ) ) { container . add ( filename ) ; } return true ; } return false ; }
adds files to container if they matched to template .
