### Question:
DocumentDocumentReferenceUserReferenceResolver extends AbstractUserReferenceResolver<DocumentReference> { @Override public UserReference resolve(DocumentReference rawReference, Object... parameters) { UserReference reference; if (rawReference == null) { reference = CurrentUserReference.INSTANCE; } else { reference = resolveName(rawReference.getName()); if (reference == null) { reference = new DocumentUserReference(rawReference, this.entityReferenceProvider); } } return reference; }  @Override UserReference resolve(DocumentReference rawReference, Object... parameters);  }### Answer:
@Test void resolve() { UserReference reference = this.resolver.resolve(new DocumentReference("wiki", "space", "page")); assertNotNull(reference); assertTrue(reference instanceof DocumentUserReference); assertEquals("wiki:space.page", ((DocumentUserReference) reference).getReference().toString()); }
@Test void resolveGuest() { UserReference reference = this.resolver.resolve(new DocumentReference("wiki", "space", "XWikiGuest")); assertSame(GuestUserReference.INSTANCE, reference); reference = this.resolver.resolve(new DocumentReference("wiki", "space", "xWiKiGuEsT")); assertSame(GuestUserReference.INSTANCE, reference); }
@Test void resolveSuperAdmin() { UserReference reference = this.resolver.resolve(new DocumentReference("wiki", "space", "superadmin")); assertSame(SuperAdminUserReference.INSTANCE, reference); reference = this.resolver.resolve(new DocumentReference("wiki", "space", "sUpErAdMiN")); assertSame(SuperAdminUserReference.INSTANCE, reference); }
@Test void resolveWhenNull() { UserReference reference = this.resolver.resolve(null); assertSame(CurrentUserReference.INSTANCE, reference); }