### Question:
DirectMessageTemplate extends AbstractTwitterOperations implements DirectMessageOperations { public List<DirectMessage> getDirectMessagesSent() { return getDirectMessagesSent(1, 20, 0, 0); } DirectMessageTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser, boolean isAuthorizedForApp); List<DirectMessage> getDirectMessagesReceived(); List<DirectMessage> getDirectMessagesReceived(int page, int pageSize); List<DirectMessage> getDirectMessagesReceived(int page, int pageSize, long sinceId, long maxId); List<DirectMessage> getDirectMessagesSent(); List<DirectMessage> getDirectMessagesSent(int page, int pageSize); List<DirectMessage> getDirectMessagesSent(int page, int pageSize, long sinceId, long maxId); DirectMessage getDirectMessage(long id); DirectMessage sendDirectMessage(String toScreenName, String text); DirectMessage sendDirectMessage(long toUserId, String text); void deleteDirectMessage(long messageId);  }### Answer:
@Test public void getDirectMessagesSent() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("messages"), APPLICATION_JSON)); List<DirectMessage> messages = twitter.directMessageOperations().getDirectMessagesSent(); assertDirectMessageListContents(messages); }
@Test public void getDirectMessagesSent_paged() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("messages"), APPLICATION_JSON)); List<DirectMessage> messages = twitter.directMessageOperations().getDirectMessagesSent(3, 25); assertDirectMessageListContents(messages); }
@Test public void getDirectMessagesSent_paged_withSinceIdAndMaxId() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("messages"), APPLICATION_JSON)); List<DirectMessage> messages = twitter.directMessageOperations().getDirectMessagesSent(3, 25, 2468, 8642); assertDirectMessageListContents(messages); }