code: static Collection<Collection<SampleDTO>> sampleDTOs(Results<Sample> samples) {
          return Lists.newArrayList(Iterables.transform(samples, new Function<Results.Row<Sample>, Collection<SampleDTO>>() {
  
              @Override
              public Collection<SampleDTO> apply(Row<Sample> input) {
                  return Collections2.transform(input.getElements(), new Function<Sample, SampleDTO>() {
  
                      @Override
                      public SampleDTO apply(Sample input) {
                          return new SampleDTO(
                                  input.getTimestamp().asMillis(),
                                  new ResourceDTO(input.getResource().getId(), unwrapMap(input.getResource().getAttributes())),
                                  input.getName(),
                                  input.getType(),
                                  input.getValue(),
                                  input.getAttributes(),
                                  input.getContext().getId());
                      }
                  });
              }
          }));
      }
docs: Convert samples to {@link SampleDTO}s.
  
  @param samples
  samples to convert.
  @return converted samples.