detect container: impl & test.