It orders its entries to comply with the Java Language Specification's recommended order. Here's a failing test that you should add:
```java
  @Test public void outOfOrderModifierSet() throws IOException {
    Set<Modifier> modifiers = new LinkedHashSet<Modifier>(Arrays.asList(FINAL, PUBLIC));
    javaWriter.emitPackage("com.squareup");
    javaWriter.beginType("com.squareup.Foo", "class", modifiers);
    javaWriter.endType();
    assertCode(""
        + "package com.squareup;\n"
        + "\n"
        + "public final class Foo {\n"
        + "}\n");
  }
```