private static void checkResourceClassDeclaration(Class<? extends Resource> resource){
  int modifiers=resource.getModifiers();
  if (resource.isLocalClass() || (resource.isMemberClass() && !Modifier.isStatic(modifiers))) {
    throw new IllegalArgumentException("Resource class must be declared static.");
  }
}

private static void checkResourceClassDeclaration ( Class < ? extends Resource > resource ) { int modifiers = resource . getModifiers ( ) ; if ( resource . isLocalClass ( ) || ( resource . isMemberClass ( ) && ! Modifier . isStatic ( modifiers ) ) ) { throw new IllegalArgumentException ( "Resource class must be declared static." ) ; } }
throws an exception if class was declared non - static or non - final .
