Source:
<code>public void testTimestamp() throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { ______TS("success : created"); FeedbackQuestionAttributes fq = getNewFeedbackQuestionAttributes(); fqDb.createEntity(fq); verifyPresentInDatastore(fq, true); String feedbackSessionName = fq.feedbackSessionName; String courseId = fq.courseId; int questionNumber = fq.questionNumber; FeedbackQuestionAttributes feedbackQuestion = fqDb.getFeedbackQuestion(feedbackSessionName, courseId, questionNumber); AssertHelper.assertDateIsNow(feedbackQuestion.getCreatedAt()); AssertHelper.assertDateIsNow(feedbackQuestion.getUpdatedAt()); ______TS("success : update lastUpdated"); int newQuestionNumber = questionNumber + 1; feedbackQuestion.questionNumber = newQuestionNumber; fqDb.updateFeedbackQuestion(feedbackQuestion); FeedbackQuestionAttributes updatedFq = fqDb.getFeedbackQuestion(feedbackSessionName, courseId, newQuestionNumber); assertFalse(feedbackQuestion.getUpdatedAt().equals(updatedFq.getUpdatedAt())); AssertHelper.assertDateIsNow(updatedFq.getUpdatedAt()); ______TS("success : keep lastUpdated"); int newQuestionNumberTwo = newQuestionNumber + 1; feedbackQuestion.questionNumber = newQuestionNumberTwo; fqDb.updateFeedbackQuestion(feedbackQuestion, true); <START> FeedbackQuestionAttributes updatedFq2 = fqDb.getFeedbackQuestion(feedbackSessionName, courseId, newQuestionNumberTwo); <END> assertTrue(updatedFq.getUpdatedAt().equals(updatedFq2.getUpdatedAt())); fqDb.deleteEntity(updatedFq2); }</code><technical_language>want consistent 2. Also, more effective simply add current feedbackQuestion.questionNumber a ++ += 1 passing variable get call instead of declaring new integers. re-using updatedFq assignment instead of a mutation. Re-using fq instead of creating feedbackQuestion a problem either</technical_language>

Target:
public void testTimestamp() throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { ______TS("success : created"); FeedbackQuestionAttributes fq = getNewFeedbackQuestionAttributes(); fqDb.createEntity(fq); verifyPresentInDatastore(fq, true); String feedbackSessionName = fq.feedbackSessionName; String courseId = fq.courseId; int questionNumber = fq.questionNumber; FeedbackQuestionAttributes feedbackQuestion = fqDb.getFeedbackQuestion(feedbackSessionName, courseId, questionNumber); AssertHelper.assertDateIsNow(feedbackQuestion.getCreatedAt()); AssertHelper.assertDateIsNow(feedbackQuestion.getUpdatedAt()); ______TS("success : update lastUpdated"); feedbackQuestion.questionNumber++; fqDb.updateFeedbackQuestion(feedbackQuestion); FeedbackQuestionAttributes updatedFq = fqDb.getFeedbackQuestion(feedbackSessionName, courseId, feedbackQuestion.questionNumber); assertFalse(feedbackQuestion.getUpdatedAt().equals(updatedFq.getUpdatedAt())); AssertHelper.assertDateIsNow(updatedFq.getUpdatedAt()); ______TS("success : keep lastUpdated"); feedbackQuestion.questionNumber++; fqDb.updateFeedbackQuestion(feedbackQuestion, true); FeedbackQuestionAttributes updatedFqTwo = fqDb.getFeedbackQuestion(feedbackSessionName, courseId, feedbackQuestion.questionNumber); assertEquals(updatedFq.getUpdatedAt(), updatedFqTwo.getUpdatedAt()); fqDb.deleteEntity(updatedFqTwo); }