### Question:
Configurations implements TabWidthAndBaseDirProvider { public Optional<String> baseDir() { for (final String attributeName : rootElement.getAttributeNames()) { if ("basedir".equals(attributeName)) { return ofNullable(getAttributeOrNull(rootElement, "basedir")); } } return empty(); } Configurations(@Nullable final Module module, @NotNull final Configuration rootElement); int tabWidth(); Optional<String> baseDir();  }### Answer:
@Test public void testBaseDir() throws IOException { final Configuration config = ConfigurationBuilder.checker().withChild( ConfigurationBuilder.config("TreeWalker").withAttribute("tabWidth", "7")).build(); assertEquals(Optional.empty(), createClassUnderTest(config).baseDir()); }
@Test public void testBaseDirFromAttribute() throws IOException { final Configuration config = ConfigurationBuilder.checker().withAttribute("foo", "bar") .withAttribute("basedir", "/some/dir").build(); assertEquals(Optional.of("/some/dir"), createClassUnderTest(config).baseDir()); }