# org.junit.jupiter.api.extension.TestInstantiationException: Test class [com.example.OuterTest$InnerTest] must be a static inner class

- **ID:** `java/junit-nested-test-not-inner`
- **Domain:** java
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

@Nested test classes must be static inner classes, but they are non-static.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 8+ | active | — | — |

## Workarounds

1. **Add static modifier to inner class** (95% success)
   ```
   @Nested
static class InnerTest {
    @Test
    void test() { }
}
   ```
2. **Move test methods to outer class** (80% success)
   ```
   // Remove @Nested and put tests directly in outer class
   ```

## Dead Ends

- **Removing @Nested annotation** — Loses organizational structure; tests may run but not nested. (60% fail)
- **Making outer class non-static** — Outer class must be static for @Nested to work. (50% fail)
