@Test
public void testFindAncestorWithClass() {

    Deque<Object> composeStack = new ArrayDeque<Object>();
    Integer integerValue = new Integer(1);
    Long longValue = new Long(LONG_VALUE);
    String stringValue = "my value";
    Integer integerValue2 = new Integer(INT_VALUE);
    composeStack.push(integerValue);
    composeStack.push(longValue);
    composeStack.push(stringValue);
    composeStack.push(integerValue2);
    assertEquals(integerValue2, ComposeStackUtil.findAncestorWithClass(composeStack, Integer.class));
    assertEquals(longValue, ComposeStackUtil.findAncestorWithClass(composeStack, Long.class));
    assertEquals(stringValue, ComposeStackUtil.findAncestorWithClass(composeStack, String.class));
    assertEquals(integerValue2, ComposeStackUtil.findAncestorWithClass(composeStack, Object.class));
    assertNull(ComposeStackUtil.findAncestorWithClass(composeStack, Date.class));
}