PackageStats implements ProjectMirror { ClassStats getClassStats(JavaTypeQualifiedName qname, boolean createIfNotFound) { PackageStats container = getSubPackage(qname, createIfNotFound); if (container == null) { return null; } String topClassName = qname.getClassList().get(0); if (createIfNotFound && container.classes.get(topClassName) == null) { container.classes.put(topClassName, new ClassStats()); } ClassStats next = container.classes.get(topClassName); if (next == null) { return null; } Iterator<String> it = qname.getClassList().iterator(); if (it.hasNext()) { it.next(); } while (it.hasNext() && next != null) { next = next.getNestedClassStats(it.next(), createIfNotFound); } return next; }  @Override boolean hasMatchingSig(JavaOperationQualifiedName qname, JavaOperationSigMask sigMask); @Override boolean hasMatchingSig(JavaTypeQualifiedName qname, String fieldName, JavaFieldSigMask sigMask); @Override ClassMirror getClassMirror(JavaTypeQualifiedName className);  }
@Test public void testAddClass() { JavaTypeQualifiedName qname = (JavaTypeQualifiedName) QualifiedNameFactory.ofString("org.foo.Boo"); assertNull(pack.getClassStats(qname, false)); assertNotNull(pack.getClassStats(qname, true)); assertNotNull(pack.getClassStats(qname, false)); }