boolean matchLevels(List<GridRecord> records) {

    // first create a new list
    List<LevelCoord> levelList = new ArrayList<LevelCoord>(records.size());
    for (GridRecord record : records) {
      LevelCoord lc = new LevelCoord(record.getLevel1(), record.getLevel2());
      if (!levelList.contains(lc)) {
        levelList.add(lc);
      }
    }

    Collections.sort(levelList);
    if (positive.equals("down")) {
      Collections.reverse(levelList);
    }

    // gotta equal existing list
    return levelList.equals(levels);
  }
boolean matchLevels(List<GridRecord> records) {

    
    List<LevelCoord> levelList = new ArrayList<LevelCoord>(records.size());
    for (GridRecord record : records) {
      LevelCoord lc = new LevelCoord(record.getLevel1(), record.getLevel2());
      if (!levelList.contains(lc)) {
        levelList.add(lc);
      }
    }

    Collections.sort(levelList);
    if (positive.equals("down")) {
      Collections.reverse(levelList);
    }

    
    return levelList.equals(levels);
  }
boolean matchLevels ( List < GridRecord > records ) { // first create a new list List < LevelCoord > levelList = new ArrayList < LevelCoord > ( records . size ( ) ) ; for ( GridRecord record : records ) { LevelCoord lc = new LevelCoord ( record . getLevel1 ( ) , record . getLevel2 ( ) ) ; if ( ! levelList . contains ( lc ) ) { levelList . add ( lc ) ; } } Collections . sort ( levelList ) ; if ( positive . equals ( "down" ) ) { Collections . reverse ( levelList ) ; } // gotta equal existing list return levelList . equals ( levels ) ; }
Match levels

@param records records to match
@return true if they have the same levels
Match levels