EZP-21418: updated InMemory storage implementation and tests