### Question:
FluentBy extends By { public static ByComposite composite(By.ByTagName b0, By.ByClassName b1) { return new ByComposite(b0, b1); }  void beforeFindElement(WebDriver driver); static ByStrictClassName strictClassName(final String className); static ByAttribute attribute(final String name); static ByAttribute attribute(final String name, final String value); static ByAttribute notAttribute(final String name); static ByComposite composite(By.ByTagName b0, By.ByClassName b1); static ByComposite composite(By.ByTagName b0, FluentBy.ByAttribute b1); static ByLast last(By by); static ByLast last();  }### Answer:
@Test public void composite_classname() throws IllegalAccessException { FindsByXPathSearchContext context = mock(FindsByXPathSearchContext.class); WebElement we = mock(WebElement.class); WebElement we2 = mock(WebElement.class); By aB = FluentBy.composite(new By.ByTagName("a"), new By.ByClassName("b")); assertThat(aB.toString(), is("FluentBy.composite([By.tagName: a, By.className: b])")); when(context.findElementByXPath(". WebElement blort = aB.findElement(context); assertThat(blort, is(we)); when(context.findElementsByXPath(". List<WebElement> blorts = aB.findElements(context); assertThat(blorts.get(0), is(we)); }
@Test public void composite_attribute() throws IllegalAccessException { FindsByXPathSearchContext context = mock(FindsByXPathSearchContext.class); WebElement we = mock(WebElement.class); WebElement we2 = mock(WebElement.class); By aB = FluentBy.composite(new By.ByTagName("a"), new FluentBy.ByAttribute("b", null)); assertThat(aB.toString(), is("FluentBy.composite([By.tagName: a, FluentBy.attribute: b])")); when(context.findElementByXPath(". WebElement blort = aB.findElement(context); assertThat(blort, is(we)); when(context.findElementsByXPath(". List<WebElement> blorts = aB.findElements(context); assertThat(blorts.get(0), is(we)); }