Java Declarative Solution
Code\njava []\nclass Solution {\n\n  public int diagonal2(int[] sides) {\n    return sides[0] * sides[0] + sides[1] * sides[1];\n  }\n\n  public int area(int[] 
# Code\n```java []\nclass Solution {\n\n  public int diagonal2(int[] sides) {\n    return sides[0] * sides[0] + sides[1] * sides[1];\n  }\n\n  public int area(int[] sides) {\n    return sides[0] * sides[1];\n  }\n\n  public int areaOfMaxDiagonal(int[][] dimensions) {\n    var max = Arrays.stream(dimensions)\n      .max(Comparator.comparing(it -> diagonal2((int[]) it)))\n      .map(it -> diagonal2(it))\n      .orElse(0);\n    return Arrays.stream(dimensions)\n      .filter(it -> diagonal2(it) == max)\n      .map(it -> area(it))\n      .max(Comparator.naturalOrder())\n      .orElse(0);\n  }\n}\n```
['Java']