@@ -0,0 +1,1859 @@
+package org.gbif.occurrence.ws.resources;%0A%0Aimport org.gbif.dwc.terms.Term;%0Aimport org.gbif.occurrence.common.TermUtils;%0A%0Aimport java.util.Set;%0Aimport javax.ws.rs.GET;%0Aimport javax.ws.rs.Path;%0Aimport javax.ws.rs.Produces;%0Aimport javax.ws.rs.core.MediaType;%0A%0Aimport com.google.common.base.Function;%0Aimport com.google.common.collect.ImmutableSet;%0Aimport com.google.common.collect.Iterables;%0Aimport com.google.inject.Singleton;%0A%0A/**%0A * List %7B@link Term%7D used in the context of an occurrence.%0A *%0A */%0A@Path(%22occurrence/term%22)%0A@Produces(MediaType.APPLICATION_JSON)%0A@Singleton%0Apublic class TermResource %7B%0A%0A  private static Set%3CTermWrapper%3E OCCURRENCE_TERMS =%0A          ImmutableSet.copyOf(%0A                  Iterables.transform(ImmutableSet.copyOf(%0A                          ImmutableSet.%3CTerm%3Ebuilder()%0A                                  .addAll(TermUtils.interpretedTerms())%0A                                  .addAll(TermUtils.verbatimTerms())%0A                                  .build())%0A                          , buildTermToTermWrapperFunction())%0A          );%0A%0A  @GET%0A  public Set%3CTermWrapper%3E getInterpretation() %7B%0A    return OCCURRENCE_TERMS;%0A  %7D%0A%0A  /**%0A   * Function to %22wrap%22 a DwcTerm inside a TermWrapper.%0A   * @return%0A   */%0A  private static Function%3CTerm, TermWrapper%3E buildTermToTermWrapperFunction()%7B%0A    return new Function%3CTerm, TermWrapper%3E() %7B%0A      @Override%0A      public TermWrapper apply(Term term) %7B%0A        return new TermWrapper(term);%0A      %7D%0A    %7D;%0A  %7D%0A%0A  private static class TermWrapper %7B%0A%0A    private final String simpleName;%0A    private final String qualifiedName;%0A%0A    public TermWrapper(Term term)%7B%0A      simpleName = term.simpleName();%0A      qualifiedName = term.qualifiedName();%0A    %7D%0A%0A    public String getSimpleName() %7B%0A      return simpleName;%0A    %7D%0A%0A    public String getQualifiedName() %7B%0A      return qualifiedName;%0A    %7D%0A  %7D%0A%0A%7D%0A

test TermResource