when I'm executing the below code I'm getting Class cast exception. I believe in an object is trying to cast with class can anyone help me
public abstract AGridFilterMenu refreshFilters();
public AGridFilterMenu supportFilter(String style, Class<? extends AFilterItem> clazz, By... childLocators) {
ArrayList<Class<By>> signature = new ArrayList<>();
for(int i = 0; i< childLocators.length; i++) {
signature.add(By.class);
}
try {
Constructor<? extends AFilterItem> construct = clazz.getConstructor((Class<?>[]) signature.toArray());
constructors.put(style, construct);
filteritemChildLocators.put(style, childLocators);
} catch (NoSuchMethodException | SecurityException e) {
throw new TestCodeException("Unsupported FilterItem signature", e);
}
return this;
}
public AFilterItem getFilter(String filterName) {
logger.trace(String.format("Retrieving filter %s", filterName));
AFilterItem item = filters.get(filterName);`enter code here`
item.bind();
return item;
}