class Builder {

  public BuildDetails build(final String resourcePath) {
    final Resource resource = resourceManager.getResource(resourcePath);
    logger.trace("{}: {}", resourcePath, resource);
    final Concatenator concatenator = new Concatenator(resourceManager);
    final Optional<BuildResource> buildResource = ofNullable(resource.adapt(BuildResource.class));
    final Optional<TestResource> testResource = ofNullable(resource.adapt(TestResource.class));
    if (buildResource.isPresent()) {
      logger.trace("Build to target");
      return concatenator.visit(buildResource.get());
    } else if (testResource.isPresent()) {
      logger.trace("Build to test");
      return concatenator.visit(testResource.get());
    }

    return new BuildDetails();
  }

  public  Builder(final ResourceManager resourceManager);

}