### Question:
ServiceDocument { public static boolean equals(ServiceDocumentDescription description, ServiceDocument currentDocument, ServiceDocument newDocument) { if (currentDocument == null || newDocument == null) { throw new IllegalArgumentException( "Null Service documents cannot be checked for equality."); } try { String currentSignature = Utils.computeSignature(currentDocument, description); String newSignature = Utils.computeSignature(newDocument, description); return currentSignature.equals(newSignature); } catch (Exception e) { if (e instanceof IllegalArgumentException) { throw (IllegalArgumentException) e; } return false; } }  void copyTo(ServiceDocument target); static boolean isDeleted(ServiceDocument document); static EnumSet<DocumentRelationship> compare(ServiceDocument stateA,
            ServiceDocument stateB,
            ServiceDocumentDescription desc,
            long timeEpsilon); static boolean equals(ServiceDocumentDescription description,
            ServiceDocument currentDocument, ServiceDocument newDocument); static boolean isBuiltInDocumentField(String name); static boolean isAutoMergeEnabledByDefaultForField(String name); static boolean isBuiltInSignatureExcludedDocumentField(String name); static boolean isBuiltInInfrastructureDocumentField(String name); static boolean isBuiltInNonIndexedDocumentField(String name); static boolean isBuiltInDocumentFieldWithNullExampleValue(String name); static boolean isLink(String name); static boolean isLinks(String name); static final String FIELD_NAME_SELF_LINK; static final String FIELD_NAME_VERSION; static final String FIELD_NAME_EPOCH; static final String FIELD_NAME_KIND; static final String FIELD_NAME_UPDATE_TIME_MICROS; static final String FIELD_NAME_UPDATE_ACTION; static final String FIELD_NAME_DESCRIPTION; static final String FIELD_NAME_OWNER; static final String FIELD_NAME_SOURCE_LINK; static final String FIELD_NAME_EXPIRATION_TIME_MICROS; static final String FIELD_NAME_AUTH_PRINCIPAL_LINK; static final String FIELD_NAME_SUFFIX_LINK; static final String FIELD_NAME_SUFFIX_LINKS; static final String FIELD_NAME_SUFFIX_ADDRESS; public ServiceDocumentDescription documentDescription; public long documentVersion; public Long documentEpoch; public String documentKind; public String documentSelfLink; public long documentUpdateTimeMicros; public String documentUpdateAction; public long documentExpirationTimeMicros; public String documentOwner; public String documentSourceLink; public String documentAuthPrincipalLink; }### Answer:
@Test public void equals() throws Throwable { ServiceDocumentDescription description = TestUtils.buildStateDescription( ComparableServiceState.class, null); ComparableServiceState initialState = new ComparableServiceState(); initialState.name = UUID.randomUUID().toString(); initialState.counter = 5L; initialState.booleanValue = false; ComparableServiceState modifiedState = new ComparableServiceState(); modifiedState.name = initialState.name; modifiedState.counter = initialState.counter; modifiedState.booleanValue = initialState.booleanValue; boolean value = ServiceDocument.equals(description, initialState, modifiedState); assertTrue(value); initialState = new ComparableServiceState(); initialState.name = UUID.randomUUID().toString(); initialState.counter = 5L; initialState.booleanValue = false; modifiedState = new ComparableServiceState(); modifiedState.name = initialState.name; modifiedState.counter = 10L; modifiedState.booleanValue = initialState.booleanValue; value = ServiceDocument.equals(description, initialState, modifiedState); assertFalse(value); initialState = new ComparableServiceState(); initialState.name = UUID.randomUUID().toString(); initialState.counter = 5L; initialState.booleanValue = false; modifiedState = new ComparableServiceState(); modifiedState.name = initialState.name; modifiedState.counter = initialState.counter; modifiedState.booleanValue = true; value = ServiceDocument.equals(description, initialState, modifiedState); assertFalse(value); initialState = new ComparableServiceState(); initialState.documentOwner = UUID.randomUUID().toString(); initialState.counter = 10L; modifiedState = new ComparableServiceState(); modifiedState.documentOwner = UUID.randomUUID().toString(); modifiedState.counter = 10L; value = ServiceDocument.equals(description, initialState, modifiedState); assertEquals(true, value); }