### Question:
SmcpThing implements Thing { @Override public ListenableFuture<?> toggleProperty(PropertyKey<Boolean> key, Modifier ... modifiers) { String path = key.getName() + "?" + PROP_METHOD_TOGGLE; if (modifiers.length > 0) { path += "&" + Modifier.convertToQuery(modifiers); } return doPost(path, null); } SmcpThing(Client client, SmcpTechnology technology); @Override boolean isLocal(); @Override ListenableFuture<?> setProperty(PropertyKey<T> key, @Nullable T value, Modifier ... modifiers); @Override ListenableFuture<?> incrementProperty(PropertyKey<T> key, T value, Modifier ... modifiers); @Override ListenableFuture<?> insertValueIntoProperty(PropertyKey<T[]> key, T value, Modifier ... modifiers); @Override ListenableFuture<?> removeValueFromProperty(PropertyKey<T[]> key, T value, Modifier ... modifiers); @Override ListenableFuture<?> toggleProperty(PropertyKey<Boolean> key, Modifier ... modifiers); @Override ListenableFuture<T> fetchProperty(PropertyKey<T> key, Modifier ... modifiers); @Override ListenableFuture<Set<PropertyKey<?>>> fetchSupportedPropertyKeys(); @Override ListenableFuture<Map<String, Object>> fetchSection(Section section, Modifier... mods); @Override @Nullable T getCachedProperty(PropertyKey<T> key); @Override Map<String, Object> copyCachedSection(Section section); @Override ListenableFuture<?> applyProperties(Map<String, Object> properties); @Override void registerPropertyListener(
            Executor executor, PropertyKey<T> key, PropertyListener<T> listener); @Override void unregisterPropertyListener(PropertyKey<T> key, PropertyListener<T> listener); @Override void registerChildListener(
            Executor executor, ChildListener listener, String traitShortName); @Override void unregisterChildListener(ChildListener listener, String traitShortName); @Override void registerSectionListener(Executor executor, Section section, SectionListener listener); @Override void unregisterSectionListener(SectionListener listener); @Override void unregisterAllListeners(); @Override ListenableFuture<Boolean> delete(); @Override ListenableFuture<T> invokeMethod(
            MethodKey<T> methodKey, Map<String, Object> arguments); @Override ListenableFuture<Collection<Thing>> fetchChildrenForTrait(
            String traitShortId); @Nullable @Override String getTraitForChild(Thing child); @Nullable @Override String getIdForChild(Thing child); @Nullable @Override Thing getChild(String traitShortId, String childId); @Nullable @Override Thing getParentThing(); @Override String toString();  }### Answer:
@Test void togglePropertyTest() throws Exception { SmcpTechnology techHosting = new SmcpTechnology(mContextA); SmcpTechnology techBacking = new SmcpTechnology(mContextA); MyLightBulb localFe = new MyLightBulb(); techHosting .getServer() .addLocalEndpoint( techHosting.getLocalEndpointManager().getLocalEndpointForScheme("loop")); techHosting.host(localFe); techHosting.getServer().start(); Thing remoteFe = techBacking.getThingForNativeUri(URI.create("loop: assertNotNull(remoteFe); assertEquals( false, remoteFe.fetchProperty(OnOffTrait.STAT_VALUE).get(500, TimeUnit.MILLISECONDS)); remoteFe.toggleProperty(OnOffTrait.STAT_VALUE).get(); assertEquals( true, remoteFe.fetchProperty(OnOffTrait.STAT_VALUE).get(500, TimeUnit.MILLISECONDS)); remoteFe.toggleProperty(OnOffTrait.STAT_VALUE).get(); tick(500); assertEquals( false, remoteFe.fetchProperty(OnOffTrait.STAT_VALUE).get(500, TimeUnit.MILLISECONDS)); }