public void assertModifiersCoherent(KotlinLightClass lightClass) { PsiClass delegate = lightClass.getDelegate(); for (String modifier : PsiModifier.MODIFIERS) { assertEquals( "Incoherent modifier: " + modifier, delegate.hasModifierProperty(modifier), lightClass.hasModifierProperty(modifier)); } }
public void assertPropertyCoherent(KotlinLightClass lightClass, String methodName) { Class<?> reflect = PsiClass.class; try { Method method = reflect.getMethod(methodName); Object lightResult = method.invoke(lightClass); Object delegateResult = method.invoke(lightClass.getDelegate()); assertEquals( "Result of method " + methodName + "() differs in light class and its delegate", delegateResult, lightResult); } catch (NoSuchMethodException e) { throw new AssertionError(e); } catch (InvocationTargetException e) { throw new AssertionError(e); } catch (IllegalAccessException e) { throw new AssertionError(e); } }