### Question:
ModuleSubstituter implements Substituter { public void addSubstitutions(Substitutions substituter, GadgetContext context, GadgetSpec spec) throws GadgetException { substituter.addSubstitution(Substitutions.Type.MODULE, "ID", Long.toString(context.getModuleId())); }  void addSubstitutions(Substitutions substituter, GadgetContext context, GadgetSpec spec);  }### Answer:
@Test public void testDefault() throws Exception { ModuleSubstituter substituter = new ModuleSubstituter(); substituter.addSubstitutions(substitutions, new GadgetContext(), spec); assertEquals("0", substitutions.getSubstitution(Type.MODULE, "ID")); }
@Test public void testSpecific() throws Exception { final long moduleId = 12345678L; ModuleSubstituter substituter = new ModuleSubstituter(); substituter.addSubstitutions(substitutions, new GadgetContext() { @Override public long getModuleId() { return moduleId; } }, spec); assertEquals(Long.toString(moduleId), substitutions.getSubstitution(Type.MODULE, "ID")); }