Question: Like in this example, <https://www.duden.de/rechtschreibung/Regen_Niederschlag> , the words are sorted in the following way:
"regelwidrig, Regelwidrigkeit, Regelzeit, regen, Regen, Regenabflussrohr, Regenanlage, regenarm, Regenbö, Regenbogen..."
that is, it is a "more non-case-sensitive" sorting than Collections.Sort() automatically does. Lowercase words come before uppercase ones like "regen, Regen".

```
ArrayList<String> regen = new ArrayList<String>( );
for(String x : new String[]{"regelwidrig", "Regelwidrigkeit", "Regelzeit",
        "regen", "Regen", "Regenabflussrohr",
        "Regenanlage", "regenarm", "Regenbö", "Regenbogen"}) {
        regen.add(x);
}

```

Collections.sort(regen) response:

`[Regelwidrigkeit, Regelzeit, Regen, Regenabflussrohr, Regenanlage, Regenbogen, Regenbö,`  

`regelwidrig, regen, regenarm]// lowercase at the end`

I can implement a comparator for this, but I'd rather take one-liner of code to get this way of sorting. Such as:
Collections.SomeMethod(regen); or Collections.Sort(regen, some\_extra\_parameter);
But I haven't found after deep google search, unfortunately.

Answer: 
Collators
=========

Use the `Collator` class for locale-sensitive `String` comparison.

Specifically, Java has support for German [collators](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/text/Collator.html):

```
Collator collator = Collator.getInstance(Locale.GERMAN);
regen.sort(collator);

```

Example:

```
List<String> inputs = new ArrayList <>(
    List.of( "regelwidrig", "Java", "Regelwidrigkeit", "Regelzeit", "regen", "Regen", "Regenabflussrohr", "Regenanlage", "regenarm", "Regenbö", "Regenbogen" )
);
inputs.sort( java.text.Collator.getInstance( Locale.GERMAN ) ) ;

```

> 
> [Java, regelwidrig, Regelwidrigkeit, Regelzeit, regen, Regen, Regenabflussrohr, Regenanlage, regenarm, Regenbö, Regenbogen]
> 
> 
>
The reason why strings are sorted the way they are naturally sorted is because the ASCII values for these characters have a lower value for *UPPERCASE* than for *lowercase*. In this case, all words starts with "R" and the ASCII value of uppercase "R" is 82 (52 hex), whereas lowercase "R" is 114 (72 hex). For that reason, `Regen` will precede `regen` when sorting in natural order (in Java).

So, using plain Java

```
public static void main(String[] args) {
    List<String> words = Arrays.asList(new String[]{"regelwidrig", "Regelwidrigkeit", "Regelzeit", "regen", "Regen", "Regenabflussrohr", "Regenanlage", "regenarm", "Regenbö", "Regenbogen"});
    Collections.sort(words);
    System.out.println(words);
}

```

Will output

```
[Regelwidrigkeit, Regelzeit, Regen, Regenabflussrohr, Regenanlage, Regenbogen, Regenbö, regelwidrig, regen, regenarm]

```

As you can see, all words starts with "R", but sorting puts all capitalized words ahead of ones that start with lowercase.

As @Pshemo indicated in his answer, you can (should) code your comparator account for case sensitivity and to reverse the order of lowercase vs uppercase as needed.