public static Duration minutes(long count) {
        return new Duration(count, TimeUnit.MINUTES);
    }
@Test
    void testSerialization() throws IOException, ClassNotFoundException {
        final Duration duration = Duration.minutes(42L);
        final byte[] bytes;
        try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
             final ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream)) {
            objectOutputStream.writeObject(duration);
            bytes = outputStream.toByteArray();
        }

        try (final ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
             final ObjectInputStream objectInputStream = new ObjectInputStream(inputStream)) {
            @SuppressWarnings("BanSerializableRead")
            final Object o = objectInputStream.readObject();
            assertThat(o)
                    .isInstanceOf(Duration.class)
                    .isEqualTo(duration);
        }
    }