ConfigurationServiceImpl implements ConfigurationService,
                                                 AsyncWatchServiceCallback { @Override public boolean cleanUpSystemRepository() { try { final FileSystem fileSystem = ioService.get(systemRepository.getUri()).getFileSystem(); if (fileSystem instanceof JGitFileSystem) { return ((JGitFileSystem) fileSystem) .getGit() .resetWithSquash("Repository clean up."); } } catch (IOException e) { LOGGER.error("Unable to reset git repository.", e); } return false; } ConfigurationServiceImpl(); @Inject  ConfigurationServiceImpl(final @Named("system") org.guvnor.structure.repositories.Repository systemRepository,
                                    final ConfigGroupMarshaller marshaller,
                                    final User identity,
                                    final @Named("configIO") IOService ioService,
                                    final @Repository Event<SystemRepositoryChangedEvent> repoChangedEvent,
                                    final @OrgUnit Event<SystemRepositoryChangedEvent> spaceChangedEvent,
                                    final Event<SystemRepositoryChangedEvent> changedEvent,
                                    final @Named("systemFS") FileSystem fs); @PostConstruct void setup(); @PreDestroy void shutdown(); @Override void startBatch(); @Override void endBatch(); @Override List<ConfigGroup> getConfiguration(final ConfigType type); @Override List<ConfigGroup> getConfiguration(final ConfigType type,
                                              final String namespace); @Override Map<String, List<ConfigGroup>> getConfigurationByNamespace(final ConfigType type); @Override boolean addConfiguration(final ConfigGroup configGroup); @Override boolean updateConfiguration(ConfigGroup configGroup); @Override boolean removeConfiguration(final ConfigGroup configGroup); @Override void callback(long value); @Override boolean cleanUpSystemRepository();  }
@Test public void cleanUpSystemRepositoryTest() { final ConfigGroup config = configurationFactory.newConfigGroup(ConfigType.REPOSITORY, "namespace", "config", "description"); configurationService.addConfiguration(config); final boolean result = configurationService.cleanUpSystemRepository(); assertTrue(result); }