### Question:
DefaultUserDetails implements UserDetails { @Override public Collection<? extends GrantedAuthority> getAuthorities() { return authorities().stream() .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); }  @Override Collection<? extends GrantedAuthority> getAuthorities(); @Override String getPassword(); @Override String getUsername(); @Override boolean isAccountNonExpired(); @Override boolean isAccountNonLocked(); @Override boolean isCredentialsNonExpired(); @Override boolean isEnabled(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void shouldBeSingleElement() { Collection<? extends GrantedAuthority> output = userDetails.getAuthorities(); int expected = 1; assertThat(output.size()).isEqualTo(expected); assertThat(output.iterator().next().getAuthority()).isEqualTo("admin"); }