Github user pnowojski commented on a diff in the pull request:
https://github.com/apache/flink/pull/4705#discussion_r145125538
--- Diff:
flink-tests/src/test/java/org/apache/flink/test/manual/CheckVisibleForTestingUsage.java
---
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.test.manual;
+
+import org.apache.flink.annotation.VisibleForTesting;
+
+import org.junit.Test;
+import org.reflections.Reflections;
+import org.reflections.scanners.MemberUsageScanner;
+import org.reflections.scanners.MethodAnnotationsScanner;
+import org.reflections.util.ClasspathHelper;
+import org.reflections.util.ConfigurationBuilder;
+
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * This test check the methods are annotated with @VisibleForTesting. But
still was called from the class
+ * which does not belong to the tests. These methods should only be called
from tests.
+ */
+public class CheckVisibleForTestingUsage {
+
+ @Test
+ public void testCheckVisibleForTesting() throws Exception {
+ final Reflections reflections = new Reflections(new
ConfigurationBuilder()
--- End diff --
Could you extract `ConfigurationBuilder` to a local variable? Now it is
hard to read.
---