### Question:
VarExporter implements VariableHost { public static void visitNamespaceVariables(String namespace, VariableVisitor visitor) { forNamespace(namespace).visitVariables(visitor); } private  VarExporter(@Nullable final String namespace, @Nullable final Class namespaceClass, final boolean declaredFieldsOnly); boolean isDeclaredFieldsOnly(); Class<?> getNamespaceClass(); static synchronized VarExporter forNamespace(String namespace); static synchronized Optional<VarExporter> forNamespaceIfExists(@Nonnull final String namespace); static synchronized VarExporter forNamespace(@Nonnull final Class<?> clazz, final boolean declaredFieldsOnly); static synchronized List<String> getNamespaces(); static VarExporter global(); static void visitNamespaceVariables(String namespace, VariableVisitor visitor); static VariableHost withTag(final String tag); VarExporter includeInGlobal(); VarExporter setParentNamespace(VarExporter namespace); String getNamespace(); VarExporter getParentNamespace(); void export(Object obj, String prefix); void export(Class c, String prefix); void export(Object obj, Member member, String prefix, String name); void export(Class c, Member member, String prefix, String name); void export(LazilyManagedVariable lazilyManagedVariable); void export(ManagedVariable managedVariable); @SuppressWarnings("unchecked") T getValue(final String variableName); @Override @SuppressWarnings("unchecked") Variable<T> getVariable(final String variableName); @Override void visitVariables(VariableVisitor visitor); Iterable<Variable> getVariables(); void dump(final PrintWriter out, final boolean includeDoc); void dumpJson(final PrintWriter out); @SuppressWarnings("unchecked") @VisibleForTesting static void resetGlobal(); @SuppressWarnings("unchecked") @Deprecated void reset();  }### Answer:
@Test public void testVisitNamespaceVariables() throws Exception { VarExporter alt = VarExporter.forNamespace("alt"); ExampleClass instance = new ExampleClass(); alt.export(instance, ""); alt.export(instance, ExampleClass.class.getField("notExported"), "", null); final AtomicInteger count = new AtomicInteger(0); VarExporter.visitNamespaceVariables("alt", var -> count.incrementAndGet()); assertEquals(6, count.get()); }