### Question:
Transformers { static Set<String> capabilitiesToTraits(Set<String> capabilities) { if(capabilities == null) { return ImmutableSet.of(); } ImmutableSet.Builder<String> builder = ImmutableSet.builder(); capabilities.forEach((s) -> capabilityToTrait(s).ifPresent(builder::add)); return builder.build(); } private  Transformers(); static Optional<GoogleDevice> modelToDevice(Model m, boolean whitelisted, @Nullable ProductCatalogEntry pm, boolean reportStateEnabled); static Map<String,Object> modelToStateMap(Model m, boolean hubOffline, boolean whitelisted, @Nullable ProductCatalogEntry pm); static Optional<MessageBody> commandToMessageBody(Model m, boolean hubOffline, String command, Map<String, Object> params, boolean whitelisted, @Nullable ProductCatalogEntry pm); static PlatformMessage requestToMessage(Request req, UUID placeId, String population, int ttl); static Response messageToResponse(PlatformMessage msg); static final Gson GSON; static final String PRODUCT_ID; static final String TYPE_HINT; }### Answer:
@Test public void testCapabilitiesToTraits() { assertEquals(ImmutableSet.of(), Transformers.capabilitiesToTraits(null)); assertEquals(ImmutableSet.of(), Transformers.capabilitiesToTraits(ImmutableSet.of())); assertEquals(ImmutableSet.of(), Transformers.capabilitiesToTraits(ImmutableSet.of(ContactCapability.NAMESPACE))); assertEquals(ImmutableSet.of( Constants.Trait.BRIGHTNESS, Constants.Trait.COLOR_SPECTRUM, Constants.Trait.COLOR_TEMPERATURE, Constants.Trait.ON_OFF, Constants.Trait.TEMPERATURE_SETTING ), Transformers.capabilitiesToTraits(ImmutableSet.of( SwitchCapability.NAMESPACE, DimmerCapability.NAMESPACE, ColorCapability.NAMESPACE, ColorTemperatureCapability.NAMESPACE, ThermostatCapability.NAMESPACE ))); }