final MockResolver r = new MockResolver(); r.setName(name); if (findRevision) { r.rmr = new ResolvedModuleRevision() { public DependencyResolver getResolver() { return r; }  public ModuleRevisionId getId() { return null; }  public Date getPublicationDate() { return publicationDate; }  public ModuleDescriptor getDescriptor() { return null; } public boolean isDownloaded() { return true; } public boolean isSearched() { return true; } }; } return r;
return buildMockResolver(name, findRevision, null, publicationDate);
    static MockResolver buildMockResolver(String name, boolean findRevision, final Date publicationDate) {        final MockResolver r = new MockResolver();        r.setName(name);        if (findRevision) {            r.rmr = new ResolvedModuleRevision() {                public DependencyResolver getResolver() {                    return r;                }                public ModuleRevisionId getId() {                    return null;                }                public Date getPublicationDate() {                    return publicationDate;                }                public ModuleDescriptor getDescriptor() {                    return null;                }                public boolean isDownloaded() {                    return true;                }                public boolean isSearched() {                    return true;                }            };        }        return r;    }