title: Spring: How to do AND in Profiles?
body: <p>Spring <a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/Profile.html">Profile</a> annotation allows you to select profiles. However if you read documentation it only allows you to select more than one profile with OR operation. If you specify @Profile("A", "B") then your bean will be up if either profile A or profile B is active.</p>
  
  <p>Our use case is different we want to support TEST and PROD versions of multiple configurations. Therefore sometimes we want to autowire the bean only if both profiles TEST and CONFIG1 are active.</p>
  
  <p>Is there any way to do it with Spring? What would be the simplest way?</p>