AntBuildTarget[] () { final List<AntBuildTargetBase> filtered = new ArrayList<>(); for (final AntBuildTargetBase buildTarget : myTargets.getValue()) { if (myFile.isTargetVisible(buildTarget)) { filtered.add(buildTarget); } } return (filtered.isEmpty()) ? AntBuildTargetBase.EMPTY_ARRAY : filtered.toArray(AntBuildTargetBase.EMPTY_ARRAY); }