Source:
<code>private Set<PageBook.Page> scanPagesToCompile(Set<Class<?>> set) { Set<Templates.Descriptor> templates = Sets.newHashSet(); Set<PageBook.Page> pagesToCompile = Sets.newHashSet(); boolean customTemplatesExist = false; if(!customTemplates.isEmpty()) { customTemplatesExist = true; <START> } <END> for (Class<?> pageClass : set) { EmbedAs embedAs = pageClass.getAnnotation(EmbedAs.class); if (null != embedAs) { final String embedName = embedAs.value(); if (Renderable.class.isAssignableFrom(pageClass)) { @SuppressWarnings("unchecked") Class<? extends Renderable> renderable = (Class<? extends Renderable>) pageClass; registry.add(embedName, renderable); } else { pagesToCompile.add(embed(embedName, pageClass)); } } At at = pageClass.getAnnotation(At.class); if (null != at) { if (pageClass.isAnnotationPresent(Service.class)) { pagesToCompile.add(pageBook.serviceAt(at.value(), pageClass)); } else if (pageClass.isAnnotationPresent(Export.class)) { resourcesService.add(SitebricksModule.class, pageClass.getAnnotation(Export.class)); } else { pagesToCompile.add(pageBook.at(at.value(), pageClass)); } } if (Stage.DEVELOPMENT != currentStage) { if(customTemplatesExist) { if(customTemplates.containsKey(pageClass)) { Templates.Descriptor descriptor = customTemplates.get(pageClass); templates.add(descriptor); continue; } } if (pageClass.isAnnotationPresent(Show.class)) { log.info("replace default template with "+ pageClass.getAnnotation(Show.class).value()); templates.add(new Templates.Descriptor(pageClass, pageClass.getAnnotation(Show.class).value())); } } } if (Stage.DEVELOPMENT != currentStage) { this.templates.loadAll(templates); } return pagesToCompile; }</code><technical_language>shorten this to: boolean customTemplatesExist = !customTemplates.isEmpty();</technical_language>

Target:
private Set<PageBook.Page> scanPagesToCompile(Set<Class<?>> set) { Set<Templates.Descriptor> templates = Sets.newHashSet(); Set<PageBook.Page> pagesToCompile = Sets.newHashSet(); boolean customTemplatesExist = !customTemplates.isEmpty(); for (Class<?> pageClass : set) { EmbedAs embedAs = pageClass.getAnnotation(EmbedAs.class); if (null != embedAs) { final String embedName = embedAs.value(); if (Renderable.class.isAssignableFrom(pageClass)) { @SuppressWarnings("unchecked") Class<? extends Renderable> renderable = (Class<? extends Renderable>) pageClass; registry.add(embedName, renderable); } else { pagesToCompile.add(embed(embedName, pageClass)); } } At at = pageClass.getAnnotation(At.class); if (null != at) { if (pageClass.isAnnotationPresent(Service.class)) { pagesToCompile.add(pageBook.serviceAt(at.value(), pageClass)); } else if (pageClass.isAnnotationPresent(Export.class)) { resourcesService.add(SitebricksModule.class, pageClass.getAnnotation(Export.class)); } else { pagesToCompile.add(pageBook.at(at.value(), pageClass)); } } if (Stage.DEVELOPMENT != currentStage) { if(customTemplatesExist && customTemplates.containsKey(pageClass)) { Templates.Descriptor descriptor = customTemplates.get(pageClass); templates.add(descriptor); continue; } if (pageClass.isAnnotationPresent(Show.class)) { templates.add(new Templates.Descriptor(pageClass, pageClass.getAnnotation(Show.class).value())); } } } if (Stage.DEVELOPMENT != currentStage) { this.templates.loadAll(templates); } return pagesToCompile; }