@Test void listConversion() { assertAll( () -> assertEquals( new CompilerFlags(null, null, null, null).toList(), listOf()), () -> assertEquals( new CompilerFlags(setOf(), listOf("-a", "-b", "-c", "-d"), null, null).toList(), listOf("-a", "-b", "-c", "-d"))); }
public List<String> toList() { List<String> flagList = new ArrayList<>(); Set<String> effectiveDefaultFlags = new LinkedHashSet<>(this.defaultFlags); effectiveDefaultFlags.removeAll(userFlags); flagList.addAll(effectiveDefaultFlags); if (sourceJavaVersion != null) { flagList.add("-source"); flagList.add(sourceJavaVersion); } if (targetJavaVersion != null) { flagList.add("-target"); flagList.add(targetJavaVersion); } flagList.addAll(userFlags); return flagList; }
CompilerFlags { public List<String> toList() { List<String> flagList = new ArrayList<>(); Set<String> effectiveDefaultFlags = new LinkedHashSet<>(this.defaultFlags); effectiveDefaultFlags.removeAll(userFlags); flagList.addAll(effectiveDefaultFlags); if (sourceJavaVersion != null) { flagList.add("-source"); flagList.add(sourceJavaVersion); } if (targetJavaVersion != null) { flagList.add("-target"); flagList.add(targetJavaVersion); } flagList.addAll(userFlags); return flagList; } }
CompilerFlags { public List<String> toList() { List<String> flagList = new ArrayList<>(); Set<String> effectiveDefaultFlags = new LinkedHashSet<>(this.defaultFlags); effectiveDefaultFlags.removeAll(userFlags); flagList.addAll(effectiveDefaultFlags); if (sourceJavaVersion != null) { flagList.add("-source"); flagList.add(sourceJavaVersion); } if (targetJavaVersion != null) { flagList.add("-target"); flagList.add(targetJavaVersion); } flagList.addAll(userFlags); return flagList; } CompilerFlags(
            Set<String> defaultFlags,
            Collection<String> userFlags,
            String sourceJavaVersion,
            String targetJavaVersion); }
CompilerFlags { public List<String> toList() { List<String> flagList = new ArrayList<>(); Set<String> effectiveDefaultFlags = new LinkedHashSet<>(this.defaultFlags); effectiveDefaultFlags.removeAll(userFlags); flagList.addAll(effectiveDefaultFlags); if (sourceJavaVersion != null) { flagList.add("-source"); flagList.add(sourceJavaVersion); } if (targetJavaVersion != null) { flagList.add("-target"); flagList.add(targetJavaVersion); } flagList.addAll(userFlags); return flagList; } CompilerFlags(
            Set<String> defaultFlags,
            Collection<String> userFlags,
            String sourceJavaVersion,
            String targetJavaVersion); List<String> toList(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
CompilerFlags { public List<String> toList() { List<String> flagList = new ArrayList<>(); Set<String> effectiveDefaultFlags = new LinkedHashSet<>(this.defaultFlags); effectiveDefaultFlags.removeAll(userFlags); flagList.addAll(effectiveDefaultFlags); if (sourceJavaVersion != null) { flagList.add("-source"); flagList.add(sourceJavaVersion); } if (targetJavaVersion != null) { flagList.add("-target"); flagList.add(targetJavaVersion); } flagList.addAll(userFlags); return flagList; } CompilerFlags(
            Set<String> defaultFlags,
            Collection<String> userFlags,
            String sourceJavaVersion,
            String targetJavaVersion); List<String> toList(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }