We investigate the $bar KN$ and coupled channels system in a finite volume and study the properties of the $Lambda(1405)$ resonance. We calculate the energy levels in a finite volume and solve the inverse problem of determining the resonance position in the infinite volume. We devise the best strategy of analysis to obtain the two poles of the $Lambda(1405)$ in the infinite volume case, with sufficient precision to distinguish them.