### Question:
EbmsMessageHistoryService extends WebServicesAdaptor { private String checkMessageBox(String input)throws SOAPRequestException{ if(input !=null && !(input.equalsIgnoreCase(MessageClassifier.MESSAGE_BOX_INBOX) || input.equalsIgnoreCase(MessageClassifier.MESSAGE_BOX_OUTBOX))){ String errMsg = "Wrong Message Box entered, you have entered: ["+ input+"]"; throw new SOAPRequestException(errMsg); }else{ return (input==null?input:input.toLowerCase()); } }  void serviceRequested(WebServicesRequest request, WebServicesResponse response); static int MAX_NUMBER; static String NAMESPACE; }### Answer:
@Test public void checkMessageBox()throws Exception{ Method m = Class.forName("hk.hku.cecid.ebms.spa.service.EbmsMessageHistoryService"). getDeclaredMethod("checkMessageBox", new Class[] {String.class}); m.setAccessible(true); Assert.assertEquals(null, m.invoke(historyService, new Object[] {null})); Assert.assertEquals(MessageClassifier.MESSAGE_BOX_INBOX, m.invoke(historyService, new Object[] {"INBOX"})); Assert.assertEquals(MessageClassifier.MESSAGE_BOX_OUTBOX, m.invoke(historyService, new Object[] {"OUTBOX"})); }