### Question:
EndpointPolicyImpl implements EndpointPolicy { public void initialize(Message m) { initializePolicy(m); checkExactlyOnes(); finalizeConfig(m); } EndpointPolicyImpl();  EndpointPolicyImpl(Policy p);  EndpointPolicyImpl(EndpointInfo ei,
                              PolicyEngineImpl engine,
                              boolean requestor,
                              Assertor assertor); Policy getPolicy(); Assertor getAssertor(); EndpointPolicy updatePolicy(Policy p, Message msg); Collection<Assertion> getChosenAlternative(); Collection<Assertion> getVocabulary(Message m); Collection<Assertion> getFaultVocabulary(Message m); List<Interceptor<? extends Message>> getInterceptors(Message m); List<Interceptor<? extends Message>> getFaultInterceptors(Message m); void initialize(Message m);  }### Answer:
@Test public void testInitialize() throws NoSuchMethodException { Message m = new MessageImpl(); Method m1 = EndpointPolicyImpl.class.getDeclaredMethod("initializePolicy", new Class[] {Message.class}); Method m2 = EndpointPolicyImpl.class.getDeclaredMethod("checkExactlyOnes", new Class[] {}); Method m3 = EndpointPolicyImpl.class.getDeclaredMethod("chooseAlternative", new Class[] {Message.class}); Method m4 = EndpointPolicyImpl.class.getDeclaredMethod("initializeVocabulary", new Class[] {Message.class}); Method m5 = EndpointPolicyImpl.class.getDeclaredMethod("initializeInterceptors", new Class[] {Message.class}); EndpointPolicyImpl epi = EasyMock.createMockBuilder(EndpointPolicyImpl.class) .addMockedMethods(m1, m2, m3, m4, m5).createMock(control); epi.initializePolicy(m); EasyMock.expectLastCall(); epi.checkExactlyOnes(); EasyMock.expectLastCall(); epi.chooseAlternative(m); EasyMock.expectLastCall(); control.replay(); epi.initialize(m); control.verify(); }