List foursides = [...] // Surface of all rectangles with a length and width greater than 2 int surface = foursides.stream().filter( (Rectangle v) -> v.width > 2 && v.height > 2). // mapToInt( (Rectangle v) -> v.width * v.height).sum(); // Parallel conversion from Rectangle to Rectangle2D.Double Set foursides2D = foursides.stream().parallel(). // map(v -> new Rectangle2D.Double(v.x, v.y, v.width, v.height)).// collect(Collectors.toSet() );