### Question:
AuthorizationFilter extends EnvironmentFilter { protected String toString(Subject subject) { PrincipalCollection pc = subject.getPrincipals(); if (pc != null && !pc.isEmpty()) { return "[" + pc.toString() + "] "; } return ""; } AuthorizationFilter(); ActionPermissionResolver getActionPermissionResolver(); void setActionPermissionResolver(ActionPermissionResolver actionPermissionResolver); @Override void addDestinationInfo(ConnectionContext context, DestinationInfo info); @Override Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean create); @Override void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout); @Override void removeDestinationInfo(ConnectionContext context, DestinationInfo info); @Override Subscription addConsumer(ConnectionContext context, ConsumerInfo info); @Override void addProducer(ConnectionContext context, ProducerInfo info); @Override void send(ProducerBrokerExchange exchange, Message message);  }### Answer:
@Test public void testSubjectToString() { Subject subject = new PermsSubject() { @Override public PrincipalCollection getPrincipals() { return null; } }; String string = filter.toString(subject); assertEquals("", string); }