   defmodule SampleCallbacks do
     @callback first(integer) :: integer
     @callback foo(atom(), binary) :: binary
-    @callback bar(External.hello, my_var :: binary) :: binary
+    @callback bar(External.hello(), my_var :: binary) :: binary
     @callback guarded(my_var) :: my_var when my_var: binary
     @callback orr(atom | integer) :: atom
     @callback literal(123, {atom}, :foo, [integer], true) :: atom
-    @macrocallback last(integer) :: Macro.t
+    @macrocallback last(integer) :: Macro.t()
     @macrocallback last() :: atom
     @optional_callbacks bar: 2, last: 0
     @optional_callbacks first: 1
   end
 
   test "callbacks" do
-    assert SampleCallbacks.behaviour_info(:callbacks) |> Enum.sort() ==
-           ["MACRO-last": 1, "MACRO-last": 2, bar: 2, first: 1, foo: 2, guarded: 1, literal: 5, orr: 1]
+    expected_callbacks = [
+      "MACRO-last": 1,
+      "MACRO-last": 2,
+      bar: 2,
+      first: 1,
+      foo: 2,
+      guarded: 1,
+      literal: 5,
+      orr: 1
+    ]
+
+    assert Enum.sort(SampleCallbacks.behaviour_info(:callbacks)) == expected_callbacks
   end
 
   test "optional callbacks" do
-    assert SampleCallbacks.behaviour_info(:optional_callbacks) |> Enum.sort() ==
-           ["MACRO-last": 1, bar: 2, first: 1]
+    assert Enum.sort(SampleCallbacks.behaviour_info(:optional_callbacks)) ==
+             ["MACRO-last": 1, bar: 2, first: 1]
   end
 
   test "default is not supported" do

          assert ast_string == "@type(literal_keyword_list_fixed_key2() :: [{:key, integer()}])"

        {:literal_struct_all_fields_any_type, _, _} ->
          assert ast_string == "@type(literal_struct_all_fields_any_type() :: %Kernel.TypespecTest.SomeStruct{key: term()})"

        {:literal_struct_all_fields_key_type, _, _} ->
          assert ast_string == "@type(literal_struct_all_fields_key_type() :: %Kernel.TypespecTest.SomeStruct{key: integer()})"

        {:builtin_fun, _, _} ->
          assert ast_string == "@type(builtin_fun() :: (... -> any()))"

  end

  test "@type with public record" do
    bytecode =
      test_module do
        require Record
        Record.defrecord(:timestamp, date: 1, time: 2)
        @type my_type :: record(:timestamp, time: :foo)
      end

    assert [type: {:my_type, type, []}] = types(bytecode)
    assert {:type, _, :tuple, [timestamp, term, foo]} = type
    assert {:atom, 0, :timestamp} = timestamp
    assert {:type, 0, :term, []} = term
    assert {:atom, 0, :foo} = foo
  end

  test "@type with private record" do
    bytecode =
      test_module do
        require Record
        Record.defrecordp(:timestamp, date: 1, time: 2)
        @type my_type :: record(:timestamp, time: :foo)
      end

    assert [type: {:my_type, type, []}] = types(bytecode)
    assert {:type, _, :tuple, args} = type
    assert [{:atom, 0, :timestamp}, {:type, 0, :term, []}, {:atom, 0, :foo}] = args
  end

  test "@type with undefined record" do
