private void appendEntryToView(String text, long timestamp) {
        Date date = new Date(timestamp);
        // Add a newline if needed or clear the text view (to get rid of the hint).
        if (!mIsHistoryEmpty) {
            mHistoryTextView.append("\n");
        } else {
            mHistoryTextView.setText("");
        }
        // Add the representation of the new entry to the text view.
        mHistoryTextView.append(String.format("%s [%s]", text, mSimpleDateFormatter.format(date)));

        mIsHistoryEmpty = false;
    }
Called when the user wants to append an entry to the history.
unit/BasicUnitAndroidTest/app/src/main/java/com/example/android/testing/unittesting/basicunitandroidtest/MainActivity.java