@Override
    public String getName() {
        final Object principal = subject.getPrincipal();
        return principal == null ? null : principal.toString();
    }
@Test
    public void testGetNameWithNull() throws Exception {
        final Subject subject = mock(Subject.class);
        final ShiroPrincipal shiroPrincipal = new ShiroPrincipal(subject);

        assertThat(shiroPrincipal.getName()).isNull();
    }