protected String toString(Subject subject) {
        PrincipalCollection pc = subject.getPrincipals();
        if (pc != null && !pc.isEmpty()) {
            return "[" + pc.toString() + "] ";
        }
        return "";
    }
@Test
    public void testSubjectToString() {
        Subject subject = new PermsSubject() {
            @Override
            public PrincipalCollection getPrincipals() {
                return null;
            }
        };
        String string = filter.toString(subject);
        assertEquals("", string);
    }