Inline to anonymous class works only for java classes