### Question:
Projection implements Comparable<Projection>, Serializable { public List<Rule> getRules() { return rules; } Projection( String sourceName,
                       String workspaceName,
                       boolean readOnly,
                       Rule... rules ); static void addRuleParser( Method method ); static void addRuleParser( ClassLoader classLoader,
                                      String className,
                                      String methodName ); static boolean removeRuleParser( Method method ); static boolean removeRuleParser( String declaringClassName,
                                            String methodName ); static Rule fromString( String definition,
                                   ExecutionContext context ); static PathRule parsePathRule( String definition,
                                          ExecutionContext context ); String getSourceName(); String getWorkspaceName(); List<Rule> getRules(); Set<Path> getPathsInSource( Path canonicalPathInRepository,
                                       PathFactory factory ); Set<Path> getPathsInRepository( Path canonicalPathInSource,
                                           PathFactory factory ); List<Path> getTopLevelPathsInRepository( PathFactory factory ); boolean isTopLevelPath( Path repositoryPath ); boolean isSimple(); boolean isReadOnly(); @Override int hashCode(); @Override boolean equals( Object obj ); int compareTo( Projection that ); @Override String toString();  }### Answer:
@Test public void shouldCreateInstanceWithValidNameAndRulesAndShouldPruneNullRuleReferences() { projection = new Projection(sourceName, workspaceName, readOnly, mockRule1, null, mockRule3); assertThat(projection.getRules().size(), is(2)); assertThat(projection.getRules(), hasItems(mockRule1, mockRule3)); }