## Steps to reproduce `assertThrows(IOException.class, () -> service.readFile("sampleFile.txt")); ` this assertion will pass even if the exception is FileNotFoundException. I believe this is happening because we are using `Class#isInstance` it will return true for parent types also. https://github.com/junit-team/junit5/blob/637a78393194737e77d6f9681ad93e9ddac1f399/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java#L58 Shouldn't this be replaced with `if (expectedType == actualException.getClass())` ?