com.example.mistakes.expression._11_IgnoredReturnValue.Ex5

🚀 com.example.mistakes.expression._11_IgnoredReturnValue.Ex5

Question fetched from API endpoint api/expression/11/5

API Response

GET /api/expression/11/5
{
  "result": [
    {
      "message": "com.example.mistakes.expression._11_IgnoredReturnValue.Ex5",
      "before": "    void before() {\n      List<String> list = List.of();\n      assertThat(!list.isEmpty());\n    }\n",
      "after": "    void after() {\n      List<String> list = List.of();\n      assertThat(!list.isEmpty()).isTrue();\n    }\n",
      "chapter": 2,
      "id": "2_11_5",
      "className": "Ex5",
      "path": "file:///home/runner/work/100_java_mistakes/100_java_mistakes/back/src/main/java/com/example/mistakes/expression/_11_IgnoredReturnValue.java"
    }
  ],
  "length": 1
}

before

before
void before() {
  List<String> list = List.of();
  assertThat(!list.isEmpty());
}

after

after
void after() {
  List<String> list = List.of();
  assertThat(!list.isEmpty()).isTrue();
}