CodeSnippet (Snippet snippet) { return snippet == null ? null : new CodeSnippet( snippet.id(), convertEnum(snippet.kind(), CodeSnippet.Kind.class), convertEnum(snippet.subKind(), CodeSnippet.SubKind.class), snippet.source(), createPresentation(snippet) ); }