AuditEvent { @NonNull public String toString() { String node = formIndex == null || formIndex.getReference() == null ? "" : getXPathPath(formIndex); String event; if (isTrackingLocationsEnabled && isTrackingChangesEnabled) { event = String.format("%s,%s,%s,%s,%s,%s,%s,%s,%s", auditEventType.getValue(), node, start, end != 0 ? end : "", latitude, longitude, accuracy, oldValue, newValue); } else if (isTrackingLocationsEnabled) { event = String.format("%s,%s,%s,%s,%s,%s,%s", auditEventType.getValue(), node, start, end != 0 ? end : "", latitude, longitude, accuracy); } else if (isTrackingChangesEnabled) { event = String.format("%s,%s,%s,%s,%s,%s", auditEventType.getValue(), node, start, end != 0 ? end : "", oldValue, newValue); } else { event = String.format("%s,%s,%s,%s", auditEventType.getValue(), node, start, end != 0 ? end : ""); } return event; } AuditEvent(long start, AuditEventType auditEventType);  AuditEvent(long start, AuditEventType auditEventType,  boolean isTrackingLocationsEnabled, boolean isTrackingChangesEnabled);  AuditEvent(long start, AuditEventType auditEventType, boolean isTrackingLocationsEnabled,
                      boolean isTrackingChangesEnabled, FormIndex formIndex, String oldValue); boolean isIntervalAuditEventType(); void setEnd(long endTime); boolean isEndTimeSet(); AuditEventType getAuditEventType(); FormIndex getFormIndex(); boolean hasNewAnswer(); boolean isLocationAlreadySet(); void setLocationCoordinates(String latitude, String longitude, String accuracy); void recordValueChange(String newValue); @NonNull String toString(); static AuditEventType getAuditEventTypeFromFecType(int fcEvent);  }
@Test public void testToString() { AuditEvent auditEvent = new AuditEvent(START_TIME, QUESTION, false, false, getTestFormIndex(), ""); assertNotNull(auditEvent); assertTrue(auditEvent.isIntervalAuditEventType()); assertEquals("question,/data/text1,1545392727685,", auditEvent.toString()); assertFalse(auditEvent.isEndTimeSet()); auditEvent.setEnd(END_TIME); assertTrue(auditEvent.isEndTimeSet()); assertFalse(auditEvent.isLocationAlreadySet()); assertEquals("question,/data/text1,1545392727685,1545392728527", auditEvent.toString()); }