### Question:
PolicyDataEngineImpl implements PolicyDataEngine { public <T> void assertMessage(Message message, T confPol, PolicyCalculator<T> policyCalculator) { T messagePol = message.get(policyCalculator.getDataClass()); final T refPolicy = (messagePol != null) ? policyCalculator.intersect(messagePol, confPol) : confPol; AssertionInfoMap amap = message.get(AssertionInfoMap.class); if (null == amap || amap.isEmpty()) { return; } Collection<AssertionInfo> ais = amap.get(policyCalculator.getDataClassName()); if (ais == null) { return; } for (AssertionInfo ai : ais) { T policy = JaxbAssertion.cast(ai.getAssertion(), policyCalculator.getDataClass()).getData(); ai.setAsserted(policyCalculator.isAsserted(message, policy, refPolicy)); } } PolicyDataEngineImpl(Bus bus); T getClientEndpointPolicy(Message m, EndpointInfo ei, Conduit c,
                                         PolicyCalculator<T> policyCalculator); T getPolicy(Message message, T confPolicy, PolicyCalculator<T> intersector); T getServerEndpointPolicy(Message m, EndpointInfo ei, Destination d,
                                         PolicyCalculator<T> policyCalculator); void assertMessage(Message message, T confPol,
                                  PolicyCalculator<T> policyCalculator);  }### Answer:
@Test public void testAssertMessage() { TestPolicy policy = new TestPolicy(); AssertionInfo ai = getTestPolicyAssertionInfo(policy); AssertionInfoMap aim = new AssertionInfoMap(CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class)); Collection<AssertionInfo> ais = new ArrayList<>(); ais.add(ai); aim.put(TEST_POLICY_NAME, ais); checkAssertWithMap(aim); assertTrue(ai.isAsserted()); }