### Question:
ApiHandlerHelpers { public static boolean validateMethod(HttpRequest request, HttpMethod expectedMethod) { return request.method() == expectedMethod; }  static boolean validateMethod(HttpRequest request, HttpMethod expectedMethod); static String validateContentType(HttpRequest request, String expectedContentType); static boolean validateAccessToken(HttpRequest request); static FullHttpResponse successResponse(ByteBuf outputBuffer, String content); static FullHttpResponse methodNotAllowedResponse(); static FullHttpResponse badRequestResponse(ByteBuf outputBuffer, String content); static FullHttpResponse unauthorizedResponse(ByteBuf outputBuffer, String content); static FullHttpResponse notFoundResponse(ByteBuf outputBuffer, String content); static FullHttpResponse internalServerErrorResponse(ByteBuf outputBuffer, String content);  }### Answer:
@Test public void testValidateMethodWhenEqual() { try { PowerMockito.when(request.method()).thenReturn(HttpMethod.POST); assertTrue(ApiHandlerHelpers.validateMethod(request, expectedMethod)); } catch (Exception e){ fail("This should not happen"); } }
@Test public void testValidateMethodWhenUnEqual() { try { PowerMockito.when(request.method()).thenReturn(HttpMethod.GET); assertFalse(ApiHandlerHelpers.validateMethod(request, expectedMethod)); } catch (Exception e){ fail("This should not happen"); } }