<p>I am writing a unit test to check that a private method will close a stream.</p>

<p>The unit test calls methodB and the variable something is null</p>

<p>The unit test doesn't mock the class on test</p>

<p>The private method is within a public method that I am calling.</p>

<p>Using emma in eclipse (via the eclemma plugin) the method call is displayed as not being covered even though the code within the method is</p>

<p>e.g</p>

<pre><code>public methodA(){

    if (something==null) {
        methodB(); //Not displayed as covered
    }
}

private methodB(){
    lineCoveredByTest; //displayed as covered
}
</code></pre>

<p>Why would the method call not be highlighted as being covered?</p>

I assume when you say 'the unit test calls
```
methodB()
```
', you mean not directly and via
```
methodA()
```
.
So, is it possible
```
methodB()
```
is being called elsewhere, by another unit test or
```
methodC()
```
maybe?