fix ClassCastException when using anounymous interfaces within static
initializers