### Question:
NoneSubjectServletCreator implements SubjectCreate { @Override public Subject createSubject(Object context) { String remoteHost = ((HttpServletRequest) context).getRemoteHost(); String requestUri = ((HttpServletRequest) context).getRequestURI(); String requestType = ((HttpServletRequest) context).getMethod(); String targetUri = requestUri.concat("===").concat(requestType).toLowerCase(); String userAgent = SurenessCommonUtil.findUserAgent((HttpServletRequest) context); return NoneSubject.builder().setRemoteHost(remoteHost) .setTargetUri(targetUri) .setUserAgent(userAgent).build(); }  @Override boolean canSupportSubject(Object context); @Override Subject createSubject(Object context);  }### Answer:
@Test public void createSubject() { HttpServletRequest request = createNiceMock(HttpServletRequest.class); expect(request.getRequestURI()).andReturn("/api/v1/book"); expect(request.getMethod()).andReturn("put"); expect(request.getRemoteHost()).andReturn("192.167.2.1"); replay(request); assertNotNull(creator.createSubject(request)); verify(request); }