You should not expect the program to behave correctly because you are not using Generics correctly.
First, you should not mix Generics with Raws, which means this statement
List<Long> longNums = new ArrayList(Arrays.asList("one", "two", "three"));
invalid (in terms of correctness). If it were:
List<Long> longNums = new ArrayList<Long>(Arrays.asList("one", "two", "three"));
it doesn't even compile, and you get an error at compile time (not at runtime, which can be more confusing and intimidating).
So, in order to compile, your list must be defined as:
List<String> longNums = new ArrayList<>(Arrays.asList("one", "two", "three"));
Further, regarding this statement
//run and pray List<Long> longNums = readProperty("prop", List.class);
there really is no way to make sure that readProperty returns a List<Long> , so you will either have to throw it or add the @SuppressWarnings annotation. The reason for this is the compiler type erase function - the parameterized Long type is erased and returned to Runtime (when readProperty() is actually executed, and prob obtained through Reflection).