<awangdev>Line Reflection_1.java
public boolean isReflected(int[][] points) {
        if (points == null || points.length == 0 || points[0] == null || points[0].length == 0) return true;
        
        Map<Integer, Set<Double>> map = new HashMap<>();
        for (int[] point : points) {
            map.putIfAbsent(point[1], new HashSet<>());
            map.get(point[1]).add((double)point[0]);
        }
        
        List<Double> sampleRow = new ArrayList<>(map.get(points[0][1]));
        Collections.sort(sampleRow);
        double mid = (sampleRow.get(0) + sampleRow.get(sampleRow.size() - 1)) / 2;
        
        for (Set<Double> row: map.values()) {
            int left = 0, right = row.size() - 1;
            List<Double> sortedRow = new ArrayList<>(row);
            Collections.sort(sortedRow);
            while (left <= right) {
                if ((sortedRow.get(left) + sortedRow.get(right)) / 2 != mid) {
                    return false;
                }
                left++;
                right--;
            }
        }
        return true;
    }
public boolean var_0 ( int [ ] [ ] var_1 ) {
  if ( var_1 == null || var_1 . length == 0 || var_1 [ 0 ] == null || var_1 [ 0 ] . length == 0 ) return true ;
  Map < Integer , Set < Double >> var_10 = new HashMap < > ( ) ;
  for ( int [ ] var_11 : var_1 ) {
    var_10 . putIfAbsent ( var_11 [ 1 ] , new HashSet < > ( ) ) ;
    var_10 . get ( var_11 [ 1 ] ) . add ( ( double ) var_11 [ 0 ] ) ;
  }
  List < Double > var_19 = new ArrayList < > ( var_10 . get ( var_1 [ 0 ] [ 1 ] ) ) ;
  Collections . sort ( var_19 ) ;
  double var_24 = ( var_19 . get ( 0 ) + var_19 . get ( var_19 . size ( ) - 1 ) ) / 2 ;
  for ( Set < Double > var_26 : var_10 . values ( ) ) {
    int var_27 = 0 , var_28 = var_26 . size ( ) - 1 ;
    List < Double > var_29 = new ArrayList < > ( var_26 ) ;
    Collections . sort ( var_29 ) ;
    while ( var_27 <= var_28 ) {
      if ( ( var_29 . get ( var_27 ) + var_29 . get ( var_28 ) ) / 2 != var_24 ) {
        return false ;
      }
      var_27 ++ ;
      var_28 -- ;
    }
  }
  return true ;
}
